Skip to content

Commit

Permalink
Fixed missing application of CONSTCONT when a cps'ed __init__ is invo…
Browse files Browse the repository at this point in the history
…ked.
  • Loading branch information
nordlander committed Sep 18, 2024
1 parent b6f8a1e commit 4d4e871
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/Acton/CodeGen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,10 @@ declCon env n q b
tRes = if t == tR then tR else tObj
pars = pPar paramNames r
args = pArg pars
initcall env | t == tR = text "return" <+> methodtable env n <> dot <> gen env initKW <> parens (gen env tmpV <> comma <+> gen env args) <> semi
initcall env | t == tR = text "return" <+> methodtable env n <> dot <> gen env initKW <> parens (gen env tmpV <> comma <+> gen env (retobj args)) <> semi
| otherwise = methodtable env n <> dot <> gen env initKW <> parens (gen env tmpV <> comma' (gen env args)) <> semi $+$
text "return" <+> gen env tmpV <> semi
retobj (PosArg e PosNil) = PosArg (eCall (tApp (eQVar primCONSTCONT) [tObj]) [e, eVar tmpV]) PosNil
retobj (PosArg e p) = PosArg e (retobj p)
retobj (PosArg e p) = PosArg (eCall (tApp (eQVar primCONSTCONT) [tObj]) [eVar tmpV, e]) p
env1 = ldefine ((tmpV, NVar tObj) : envOf pars) env
abstr = abstractAttrs env (NoQ n)

Expand Down

0 comments on commit 4d4e871

Please sign in to comment.