Fix für PHP codegen integer modulo calculation.
This commit is contained in:
parent
e4e8ebd4a5
commit
5450c944d7
1 changed files with 8 additions and 0 deletions
|
|
@ -472,6 +472,14 @@ proc arith(p: PProc, n: PNode, r: var TCompRes, op: TMagic) =
|
||||||
r.res = "intval($1 / $2)" % [x.rdLoc, y.rdLoc]
|
r.res = "intval($1 / $2)" % [x.rdLoc, y.rdLoc]
|
||||||
else:
|
else:
|
||||||
arithAux(p, n, r, op, jsOps)
|
arithAux(p, n, r, op, jsOps)
|
||||||
|
of mModI:
|
||||||
|
if p.target == targetPHP:
|
||||||
|
var x, y: TCompRes
|
||||||
|
gen(p, n.sons[1], x)
|
||||||
|
gen(p, n.sons[2], y)
|
||||||
|
r.res = "($1 % $2)" % [x.rdLoc, y.rdLoc]
|
||||||
|
else:
|
||||||
|
arithAux(p, n, r, op, jsOps)
|
||||||
of mShrI:
|
of mShrI:
|
||||||
var x, y: TCompRes
|
var x, y: TCompRes
|
||||||
gen(p, n.sons[1], x)
|
gen(p, n.sons[1], x)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue