bug-dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-dejagnu] PATCH: always restore variables in multipass mode


From: Jacob Bachmeyer
Subject: [Bug-dejagnu] PATCH: always restore variables in multipass mode
Date: Wed, 21 Nov 2018 18:29:05 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

This was found while splitting a new variable out of some uses of $srcdir when Emacs paren highlighting did not look right. Sure enough, the per-pass variables are set unconditionally, but are only restored if the "Go digging for tests" branch was taken. This patch moves that loop out of an "else" block and into the same "foreach" that contains the loop that sets per-pass variables.

ChangeLog entry:
----
        * runtest.exp: Ensure that multipass pass variables are always
        restored.  Previously, they were only restored if the "Go digging
        for tests" branch was taken near the end of runtest.exp.
----

patch:
----
diff --git a/runtest.exp b/runtest.exp
index e240d88..8e6fa18 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -1934,15 +1934,16 @@ foreach current_target $target_list {
                    }
                }
            }
-           # Restore the variables set by this pass.
-           foreach varval $restore {
-               if { [llength $varval] > 1 } {
-                   verbose "Restoring [lindex $varval 0] to [lindex $varval 
1]" 4
-                   set [lindex $varval 0] [lindex $varval 1]
-               } else {
-                   verbose "Restoring [lindex $varval 0] to `unset'" 4
-                   unset -- [lindex $varval 0]
-               }
+       }
+
+       # Restore the variables set by this pass.
+       foreach varval $restore {
+           if { [llength $varval] > 1 } {
+               verbose "Restoring [lindex $varval 0] to [lindex $varval 1]" 4
+               set [lindex $varval 0] [lindex $varval 1]
+           } else {
+               verbose "Restoring [lindex $varval 0] to `unset'" 4
+               unset -- [lindex $varval 0]
            }
        }
    }
----


-- Jacob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]