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,13 +1243,16 @@ 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 pat = n.sons[0].sym.loc.r.data
|
let f = n[0].sym
|
||||||
internalAssert pat != nil
|
if f.loc.r == nil: f.loc.r = mangleName(f, p.target)
|
||||||
if pat.contains({'#', '(', '@'}):
|
if sfInfixCall in f.flags:
|
||||||
var typ = skipTypes(n.sons[0].typ, abstractInst)
|
let pat = n.sons[0].sym.loc.r.data
|
||||||
assert(typ.kind == tyProc)
|
internalAssert pat != nil
|
||||||
genPatternCall(p, n, pat, typ, r)
|
if pat.contains({'#', '(', '@'}):
|
||||||
return
|
var typ = skipTypes(n.sons[0].typ, abstractInst)
|
||||||
|
assert(typ.kind == tyProc)
|
||||||
|
genPatternCall(p, n, pat, typ, r)
|
||||||
|
return
|
||||||
gen(p, n.sons[1], r)
|
gen(p, n.sons[1], r)
|
||||||
if r.typ == etyBaseIndex:
|
if r.typ == etyBaseIndex:
|
||||||
if r.address == nil:
|
if r.address == nil:
|
||||||
|
|
@ -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