fixes a critical PHP codegen bug
This commit is contained in:
parent
d2b191dc73
commit
55aa4c2689
1 changed files with 11 additions and 8 deletions
|
|
@ -1243,6 +1243,9 @@ proc genPatternCall(p: PProc; n: PNode; pat: string; typ: PType;
|
||||||
|
|
||||||
proc genInfixCall(p: PProc, n: PNode, r: var TCompRes) =
|
proc genInfixCall(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
# don't call '$' here for efficiency:
|
# don't call '$' here for efficiency:
|
||||||
|
let f = n[0].sym
|
||||||
|
if f.loc.r == nil: f.loc.r = mangleName(f, p.target)
|
||||||
|
if sfInfixCall in f.flags:
|
||||||
let pat = n.sons[0].sym.loc.r.data
|
let pat = n.sons[0].sym.loc.r.data
|
||||||
internalAssert pat != nil
|
internalAssert pat != nil
|
||||||
if pat.contains({'#', '(', '@'}):
|
if pat.contains({'#', '(', '@'}):
|
||||||
|
|
@ -1266,7 +1269,7 @@ proc genInfixCall(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
genArgs(p, n, r, 2)
|
genArgs(p, n, r, 2)
|
||||||
|
|
||||||
proc genCall(p: PProc, n: PNode, r: var TCompRes) =
|
proc genCall(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
if thisParam(p, n.sons[0].typ) != nil:
|
if n.sons[0].kind == nkSym and thisParam(p, n.sons[0].typ) != nil:
|
||||||
genInfixCall(p, n, r)
|
genInfixCall(p, n, r)
|
||||||
return
|
return
|
||||||
if p.target == targetPHP:
|
if p.target == targetPHP:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue