You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <stdio.h>
#include <stdlib.h>
static double *bla;
int main (int argc, char *argv[]) {
int i = 0;
bla = malloc (8 * 16);
for (i = 0; i < 16; ++i)
bla[i] = 4294967295.0;
unsigned int x = (unsigned int)bla[6];
printf ("x is %f x is %x\n", bla[6], x);
return 0;
}
Thanks, yeah, looks like in clamp mode we currently just clamp to [-2147483648..2147483648), which is indeed odd for an unsigned conversion. We should clamp to unsigned values when the operation is an unsigned one.
Test case:
How to compile it:
It prints
x is 4294967295.000000 x is 80000000
The expected value for x is ffffffff and it works as expected if BINARYEN_TRAP_MODE is not passed.
The text was updated successfully, but these errors were encountered: