forked from GitHub/gf-core
bugfix in the byte code compiler
This commit is contained in:
@@ -130,12 +130,12 @@ compileFun gr arity st vs (Let (x, (_, e1)) e2) h0 bs args =
|
|||||||
compileFun gr arity st vs e _ _ _ = error (show e)
|
compileFun gr arity st vs e _ _ _ = error (show e)
|
||||||
|
|
||||||
compileArg gr st vs (Q(m,id)) h0 bs =
|
compileArg gr st vs (Q(m,id)) h0 bs =
|
||||||
let h1 = h0 + 2
|
case lookupAbsDef gr m id of
|
||||||
in case lookupAbsDef gr m id of
|
Ok (_,Just _) -> (h0,bs,GLOBAL (i2i id),[])
|
||||||
Ok (_,Just _) -> (h1,bs,GLOBAL (i2i id),[])
|
|
||||||
_ -> let Ok ty = lookupFunType gr m id
|
_ -> let Ok ty = lookupFunType gr m id
|
||||||
(ctxt,_,_) = typeForm ty
|
(ctxt,_,_) = typeForm ty
|
||||||
c_arity = length ctxt
|
c_arity = length ctxt
|
||||||
|
h1 = h0 + 2
|
||||||
in if c_arity == 0
|
in if c_arity == 0
|
||||||
then (h1,bs,HEAP h0,[PUT_CONSTR (i2i id)])
|
then (h1,bs,HEAP h0,[PUT_CONSTR (i2i id)])
|
||||||
else let is2 = [SET (ARG_VAR (i+1)) | i <- [0..c_arity-1]]
|
else let is2 = [SET (ARG_VAR (i+1)) | i <- [0..c_arity-1]]
|
||||||
|
|||||||
Reference in New Issue
Block a user