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

_______________________________________________
Bug-dejagnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-dejagnu

Reply via email to