Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
2.1.0
-
None
-
Debian GNU/Linux sid i386
-
-
d8c97a5f0 (2.1)
Description
Now QuickJS builds fine on x86 (32-bit), but there is a problem with floats. Consider the following test C program:
#include <stdio.h> #include "quickjs.h" int main() { JSContext *ctx = NULL; /* unused anyway */ double d = 1.2; JSValue val = JS_NewFloat64Impl(ctx, d); double d2 = JS_VALUE_GET_FLOAT64(val); printf("d2 = %f\n", d2); printf("tag = %d\n", JS_VALUE_GET_TAG(val)); printf("expected = %d\n", JS_TAG_FLOAT64); return 0; }
I put it to src/shared/quickjs directory and compile using gcc test.c -o test.
Output on x86_64:
$ ./test d2 = 1.200000 tag = 7 expected = 7
Output on x86:
$ ./test d2 = 1.200000 tag = -1074056409 expected = 7
As you can see, the tag is wrong, which makes some tests fail.
Attachments
For Gerrit Dashboard: QBS-1745 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
493895,3 | Make checking for float64 tags work on 32-bit architectures | 2.1 | qbs/qbs | Status: MERGED | +2 | +1 |