Skip to content
This repository

Correct {U}Integer overflow behavior #154

Open
mgehre opened this Issue · 0 comments

1 participant

mgehre
mgehre
Collaborator

Arithmetic operations on {U}Integers should be carried out after converting them to Numbers. For example

var i1:uint = UINT_MAX;
var i2:uint = 1;
trace(i1+i2);

will not trace '-1', but UINT_MAX+1 and the result will be of type Number (not uint!).

It is still not clear how to generate the fastest code for that. Either
1) convert all {U}Integer to double and operate on them
2) operate on the integer value and just convert them if a overflow occurs

See also the last two paragraphs of https://mail.mozilla.org/pipermail/tamarin-devel/2009-November/001252.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.