Fixed
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Zac SpitzerZac SpitzerPriority
NewFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Zac Spitzer
Zac SpitzerPriority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Created 12 December 2024 at 13:38
Updated 15 March 2025 at 14:02
Resolved 17 December 2024 at 12:30
After switching back to precise mode being off by default, the following tests started to fail
It seems different byte code is generated depending on the setting of precise mode
Failed test.functions.BitOr should correctly perform bitwise OR between two large String values Expected [18446744073709551615] but received [9223372036854778000] /test/functions/BitOr.cfc:58 Failed test.functions.BitXor Checking BitXOr() function with different large numbers Expected [18446744073709551614] but received [18446744073709552001] /test/functions/BitXor.cfc:50
both tests use
application action="update" preciseMath=true;
https://github.com/lucee/Lucee/blob/6.2/test/functions/BitXor.cfc#L50
https://github.com/lucee/Lucee/blob/6.2/test/functions/BitOr.cfc#L58
but the bytecode differs depending on if the number is passed as a string or number
as number it’s
LiteralValue.toNumber(paramPageContext, Long.MAX_VALUE)
paramPageContext.getFunction(paramPageContext.getFunction(paramPageContext.us(), keys[6], new Object[] { FunctionHandlerPool.invoke(paramPageContext, new Object[] { LiteralValue.toNumber(paramPageContext, "9223372036854775808"), LiteralValue.toNumber(paramPageContext, Long.MAX_VALUE) }"lucee.runtime.functions.math.BitOr") }), keys[7], new Object[] { LiteralValue.toNumber(paramPageContext, "18446744073709551615") }); application6 = (Application)((PageContextImpl)paramPageContext).use("lucee.runtime.tag.Application", "cfapplication", 4, "D:\\work\\lucee6\\test\\functions\\BitOr.cfc:66"); try { application6.setCgireadonly(true); application6.setTypechecking(true); application6.setAction("update"); application6.setPrecisemath(false); application6.doStartTag(); if (application6.doEndTag() == 5) throw Abort.newInstance(0); } finally { ((PageContextImpl)paramPageContext).reuse((Tag)application6); }
as string, it’s
LiteralValue.toNumber(paramPageContext, "9223372036854778000")
paramPageContext.getFunction(paramPageContext.getFunction(paramPageContext.us(), keys[6], new Object[] { FunctionHandlerPool.invoke(paramPageContext, new Object[] { LiteralValue.toNumber(paramPageContext, "9223372036854778000"), LiteralValue.toNumber(paramPageContext, "9223372036854778000") }"lucee.runtime.functions.math.BitOr") }), keys[7], new Object[] { "18446744073709551615" }); application4 = (Application)((PageContextImpl)paramPageContext).use("lucee.runtime.tag.Application", "cfapplication", 4, "D:\\work\\lucee6\\test\\functions\\BitOr.cfc:59"); try { application4.setCgireadonly(true); application4.setTypechecking(true); application4.setAction("update"); application4.setPrecisemath(false); application4.doStartTag(); if (application4.doEndTag() == 5) throw Abort.newInstance(0); } finally { ((PageContextImpl)paramPageContext).reuse((Tag)application4); }