Skip to content

Commit e3d154d

Browse files
committed
touchups
1 parent 5c7c12f commit e3d154d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎src/Wasm/Exec/Eval.hs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,10 @@ step(Code cs cfg vs (e:es)) = (`runReaderT` cfg) $ do
488488
Right () -> k vs' es
489489
Left exn -> k vs' (Trapping (memoryErrorString exn) @@ at : es)
490490

491-
(MemoryCopy, I32 cnt : I32 src : I32 dst : vs') -> {-# SCC step_MemoryFill #-} do
491+
(MemoryCopy, I32 cnt : I32 src : I32 dst : vs') -> {-# SCC step_MemoryCopy #-} do
492492
inst <- getFrameInst
493493
mem <- lift $ memory inst (0 @@ at)
494-
let addr_dst = fromIntegral $ i64_extend_u_i32 (fromIntegral dst)
495-
let addr_src = fromIntegral $ i64_extend_u_i32 (fromIntegral src)
494+
let [addr_dst, addr_src] = fromIntegral . i64_extend_u_i32 . fromIntegral <*> [dst, src]
496495
eres <- lift $ lift $ runExceptT $
497496
mapM_ (\off -> Memory.loadPacked Pack8 ZX mem addr_src off I32Type >>= Memory.storePacked Pack8 mem addr_dst off) [0 .. pred cnt]
498497
case eres of

0 commit comments

Comments
 (0)