This also happens in 26.3.
Steps to Reproduce:
Run: /compute default integer {type:"mul",inputs:[769546,494770,48448661]}
Observed Results:
Number provider returned value 4
Expected Results:
Number provider returned invalid value, like /compute default integer {type:"mul",inputs:[2147483647,2]} does. The
real product is 18446744073709551620 (2^64 + 4).
Code analysis:
Product#getIntUnsafe multiplies into a long with value *= ... and only checks the final result with
ContextIntProvider.longToIntSafe. When the long itself overflows, the wrapped value can fall back inside the int range
and pass the check. Using Math.multiplyExact in the loop would fix this.
Comments 0
No comments.