Skip to content

Commit a78e986

Browse files
committed
Fix bad arg serialization
1 parent 584bb40 commit a78e986

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

unison-runtime/src/Unison/Runtime/ANF.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,8 +1535,11 @@ type ANFD v = Compose (ANFM v) (Directed ())
15351535
data GroupRef = GR Reference Word64
15361536
deriving (Show)
15371537

1538+
-- | A value which is either unboxed or boxed.
15381539
type UBValue = Either Word64 Value
15391540

1541+
-- | A list of either unboxed or boxed values.
1542+
-- Each slot is one of unboxed or boxed but not both.
15401543
type ValList = [UBValue]
15411544

15421545
data Value

unison-runtime/src/Unison/Runtime/Decompile.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ decompile backref topTerms = \case
164164
-- Only match lists of boxed args.
165165
| ([], bs) <- partitionEithers vs ->
166166
apps' (con rf ct) <$> traverse (decompile backref topTerms) bs
167-
(DataC rf _ _) -> err (BadData rf) $ bug "<Data>"
168167
(PApV (CIx rf rt k) _ (partitionEithers -> ([], bs)))
169168
| rf == Builtin "jumpCont" ->
170169
err Cont $ bug "<Continuation>"
@@ -179,6 +178,7 @@ decompile backref topTerms = \case
179178
| otherwise -> err (UnkComb rf) $ ref () rf
180179
(PAp (CIx rf _ _) _ _) ->
181180
err (BadPAp rf) $ bug "<Unknown>"
181+
(DataC rf _ _) -> err (BadData rf) $ bug "<Data>"
182182
BlackHole -> err Exn $ bug "<Exception>"
183183
(Captured {}) -> err Cont $ bug "<Continuation>"
184184
(Foreign f) ->

unison-runtime/src/Unison/Runtime/MCode.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ data Args
267267
| VArg2 !Int !Int
268268
| VArgR !Int !Int
269269
| VArgN {-# UNPACK #-} !(PrimArray Int)
270-
| -- TODO: What do I do with this?
271-
VArgV !Int
270+
| VArgV !Int
272271
deriving (Show, Eq, Ord)
273272

274273
argsToLists :: Args -> [Int]

unison-runtime/src/Unison/Runtime/MCode/Serialize.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ instance Tag ArgsT where
264264
putArgs :: (MonadPut m) => Args -> m ()
265265
putArgs ZArgs = putTag ZArgsT
266266
putArgs (VArg1 i) = putTag Arg1T *> pInt i
267-
putArgs (VArg2 i j) = putTag Arg1T *> pInt i *> pInt j
267+
putArgs (VArg2 i j) = putTag Arg2T *> pInt i *> pInt j
268268
putArgs (VArgR i j) = putTag ArgRT *> pInt i *> pInt j
269269
putArgs (VArgN pa) = putTag ArgNT *> putIntArr pa
270270
putArgs (VArgV i) = putTag ArgVT *> pInt i

0 commit comments

Comments
 (0)