diff options
Diffstat (limited to 'VM.hs')
-rw-r--r-- | VM.hs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -81,7 +81,8 @@ vmRunInstr info@(Info bbmap gfds datas) state@(State { sTempMap = tmap, sArgs = (rv, _) <- vmRunBB info (state { sArgs = map (findRef tmap) as, sCloVals = clvals }) bb return (assignRef state dest rv) Nothing -> do - (rv, state') <- vmRunBuiltin state clname (map (findRef tmap) as) + -- Take 'tail as' to skip the first self-link argument + (rv, state') <- vmRunBuiltin state clname (map (findRef tmap) (tail as)) return (assignRef state' dest rv) obj -> error $ "VM: Cannot call non-closure object: " ++ show obj IAllocClo name clrefs -> return (assignRef state dest (RVClosure name (map (findRef tmap) clrefs))) |