Commit e8812a63 authored by simonmar's avatar simonmar
Browse files

[project @ 2003-01-06 13:12:37 by simonmar]

The FUN application code is wrong when entering a BCO, because the BCO
entry code assumes a stack-only calling convention.  Use the PAP entry
code instead, which also uses a stack-only convention.
parent 4de89387
......@@ -246,6 +246,7 @@ genApply args =
text "F_ " <> fun_ret_label <> text "( void )\n{",
nest 4 (vcat [
text "StgInfoTable *info;",
text "F_ target;",
text "nat arity;",
-- if fast == 1:
......@@ -311,7 +312,8 @@ genApply args =
text "case BCO:",
nest 4 (vcat [
text "arity = BCO_ARITY((StgBCO *)R1.p);",
text "goto apply_fun;"
text "target = (F_)&stg_BCO_entry;",
text "goto apply_pap;"
]),
-- if fast == 1:
......@@ -326,7 +328,6 @@ genApply args =
text "case FUN_STATIC:",
nest 4 (vcat [
text "arity = itbl_to_fun_itbl(info)->arity;",
text "apply_fun:",
text "ASSERT(arity > 0);",
genMkPAP "BUILD_PAP" "GET_ENTRY(R1.cl)" False{-not PAP-}
args all_args_size fun_info_label
......@@ -339,8 +340,10 @@ genApply args =
text "case PAP:",
nest 4 (vcat [
text "arity = ((StgPAP *)R1.p)->arity;",
text "target = (F_)&stg_PAP_entry;",
text "apply_pap:",
text "ASSERT(arity > 0);",
genMkPAP "NEW_PAP" "stg_PAP_entry" True{-is PAP-}
genMkPAP "NEW_PAP" "target" True{-is PAP-}
args all_args_size fun_info_label
]),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment