New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounds checking for xs:integer
is broken.
#760
Comments
More weirdness: let $P63 := xs:decimal('9223372036854775808'),
$P64 := $P63 + $P63
return $P63 - $P64 idiv 2 Should return |
Related: I don't think this is easy to fix because the unary minus has a A solution would be to parse an integer literal |
Exact bounds checking for `xs:integer` operations.
The bugs of the first two comments are resolved; the last observation could be resolved by introducing BigInt instances (the cast proposal leads to wrong error codes, |
BaseX uses
double
calculations in order to check if 64-bitlong
calculations overflow. As IEEE754double
s only have 53 significant binary digits but operations onlong
need up to 128, this is unsafe:-9223372036854775807 - 1024
silently underflows to9223372036854774785
even though the boundary check inorg.basex.query.expr.Calc
is in place.The text was updated successfully, but these errors were encountered: