fix evil bug
unwind unsaturated SC rule was not firing
This commit is contained in:
17
src/GM.hs
17
src/GM.hs
@@ -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`
|
||||||
|
|||||||
Reference in New Issue
Block a user