fix evil bug

unwind unsaturated SC rule was not firing
This commit is contained in:
crumbtoo
2023-12-07 09:39:26 -07:00
parent d5e18efad4
commit 791c5f6478

View File

@@ -396,15 +396,18 @@ step st = case head (st ^. gmCode) of
-- leave the Unwind instr; continue unwinding -- leave the Unwind instr; continue unwinding
& gmStack %~ (f:) & gmStack %~ (f:)
NGlobal k _ NGlobal n _
| n < k -> st | k <= n -> traceWith (render . showState) $ st
& gmCode .~ i' & gmCode .~ i
& gmStack .~ s' & gmStack .~ s'
& gmDump .~ d' & gmDump .~ d
where where
((i',s') : d') = st ^. gmDump as = st ^. gmStack
n = st ^. gmStack & length s' = last as : s
-- assumes length s < d (i.e. enough args have been supplied) ((i,s) : d) = st ^. gmDump
k = length as
-- assumes length s > d (i.e. enough args have been supplied)
NGlobal n c -> st NGlobal n c -> st
-- 'jump' to global's code by replacing our current -- 'jump' to global's code by replacing our current
-- code with `c` -- code with `c`