Commit 91b4fbd
committed
Restore Saved_State/Halt_State when a longjmp happens
this fixes CC#2190, which is illustrated by:
attempt [; this sets Saved_State
catch/quit [ ;this calls Try_Block_Halt and sets Halt_State
print x ; this causes an error, and calls
;"longjmp(*State_State)", which invalidates
; Halt_State above.
]
]
load %./ ;Just tries to fill up the C stack and messes up "Halt_State".
halt ; Jumps to the invalid "Halt_State", and crashes
or
catch/quit [ ;sets Halt_State
attempt [ ;sets Saved_State
quit ; jumps to Halt_State, and invalidates "Saved_State"
]
]
print x ; Causes a jump to the invalid "Saved_State"1 parent 6309450 commit 91b4fbd
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
| 1073 | + | |
1073 | 1074 | | |
1074 | 1075 | | |
1075 | 1076 | | |
| 1077 | + | |
| 1078 | + | |
1076 | 1079 | | |
1077 | 1080 | | |
1078 | 1081 | | |
| |||
1733 | 1736 | | |
1734 | 1737 | | |
1735 | 1738 | | |
| 1739 | + | |
1736 | 1740 | | |
1737 | 1741 | | |
1738 | 1742 | | |
| |||
1741 | 1745 | | |
1742 | 1746 | | |
1743 | 1747 | | |
| 1748 | + | |
| 1749 | + | |
1744 | 1750 | | |
1745 | 1751 | | |
1746 | 1752 | | |
| |||
0 commit comments