diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2014-10-16 10:00:32 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2014-10-16 10:00:32 +0000 |
| commit | 26ad164cecc65afd9420e0ac34a15d49b02e6cbf (patch) | |
| tree | 327fb80f9d2281199737f6db0ca6bdcc336729c2 /src/runtime/haskell | |
| parent | b70dba87bab5dfc8039f0b9f69e0851f92324f8b (diff) | |
finally proper stack unwind in the evaluator
Diffstat (limited to 'src/runtime/haskell')
| -rw-r--r-- | src/runtime/haskell/PGF/Binary.hs | 7 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/ByteCode.hs | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/runtime/haskell/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs index 9a74ac2f2..93214038c 100644 --- a/src/runtime/haskell/PGF/Binary.hs +++ b/src/runtime/haskell/PGF/Binary.hs @@ -168,9 +168,10 @@ instance Binary Instr where put (EVAL (ARG_VAR n) (UpdateCall b c)) = putWord8 49 >> put n >> put (b,c)
put (EVAL (FREE_VAR n) (UpdateCall b c)) = putWord8 50 >> put n >> put (b,c)
put (EVAL (GLOBAL id) (UpdateCall b c)) = putWord8 51 >> put id >> put (b,c)
- put (DROP n l ) = putWord8 52 >> put (n,l)
- put (FAIL ) = putWord8 56
- put (ADD ) = putWord8 60
+ put (DROP n ) = putWord8 52 >> put n
+ put (JUMP l ) = putWord8 56 >> put l
+ put (FAIL ) = putWord8 60
+ put (ADD ) = putWord8 64
instance Binary Type where
put (DTyp hypos cat exps) = put (hypos,cat,exps)
diff --git a/src/runtime/haskell/PGF/ByteCode.hs b/src/runtime/haskell/PGF/ByteCode.hs index ababdde0d..46f81cff9 100644 --- a/src/runtime/haskell/PGF/ByteCode.hs +++ b/src/runtime/haskell/PGF/ByteCode.hs @@ -26,7 +26,8 @@ data Instr | SET_PAD | PUSH IVal | EVAL IVal TailInfo - | DROP {-# UNPACK #-} !Int {-# UNPACK #-} !CodeLabel + | DROP {-# UNPACK #-} !Int + | JUMP {-# UNPACK #-} !CodeLabel | FAIL | ADD @@ -60,7 +61,8 @@ ppInstr (SET v) = text "SET " <+> ppIVal v ppInstr (SET_PAD ) = text "SET_PAD" ppInstr (PUSH v) = text "PUSH " <+> ppIVal v ppInstr (EVAL v ti) = text "EVAL " <+> ppIVal v <+> ppTailInfo ti -ppInstr (DROP n l ) = text "DROP " <+> int n <+> ppLabel l +ppInstr (DROP n ) = text "DROP " <+> int n +ppInstr (JUMP l ) = text "JUMP " <+> ppLabel l ppInstr (FAIL ) = text "FAIL" ppInstr (ADD ) = text "ADD" |
