Skip to content

Commit 667e8bb

Browse files
ChrisJeffersonfingolfin
authored andcommitted
Do not reset tilde in ClearError
This is undoing an earlier fix. The problem was that the ~ variable is not cleared when exiting a break loop, or after an error. Reseting it's value in ClearError fixed this, but it turns out ClearError is called even when there are no errors, for example after reading a file. This does reintroduce a tilde problem -- but it will only be hit by programs which cause an error, then try to read tilde and find it has a value, when it shouldn't.
1 parent 4a0c81c commit 667e8bb

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/stats.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,9 +1783,8 @@ void ClearError ( void )
17831783
}
17841784
}
17851785

1786-
/* reset <TLS(NrError)> and Tilde */
1786+
/* reset <TLS(NrError)> */
17871787
TLS(NrError) = 0;
1788-
AssGVarUnsafe(Tilde, 0);
17891788
}
17901789

17911790
/****************************************************************************

tst/testinstall/tilde.tst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ Error, Variable: 'aqq' must have a value
44
Syntax error: ; expected in stream:1
55
aqq~ := 1;
66
^
7-
gap> ~a := 1;
8-
Error, Variable: '~' must have a value
9-
Syntax error: ; expected in stream:1
10-
~a := 1;
11-
^
127
gap> ~ := 1;
138
Error, '~' cannot be assigned
149
gap> l := [2, ~];
@@ -51,6 +46,4 @@ Syntax error: ~ is not a valid name for an argument in stream:1
5146
^
5247
gap> ({} -> ~);
5348
function( ) ... end
54-
gap> ({} -> ~)();
55-
Error, Variable: '~' must have an assigned value
5649
gap> STOP_TEST( "tilde.tst", 1);

0 commit comments

Comments
 (0)