Bug in Phix (with fix)
- Posted by petelomax Mar 29, 2017
- 1507 views
In code such as the following
integer cdx = find(cemi,"CEeMm")-(cemi='m')
The (cem='m') part was overwriting the result from find, in eax, then subtracting eax from eax, and therefore always setting cdx to 0.
Embarrassing, to be sure, but the fix is pretty trivial, and I figured I ought to post it here just in case it saves someone a bit of grief.
(Either that or ship the next version of Phix a bit prematurely.)
In pmain,e/StoreVar(), add 5 lines after the BranchOp check on line 2135:
elsif opTopIsOp=BranchOp then -- branch, I mean relational... --added 29/3/17 if newEBP then -- save eax if rqd saveFunctionResultVars(opsidx,INTSTOO) end if
Pete