The cast from NaN (or +/-Infinity) to an integer has undefined behavior in C.
Usually it casts to zero, but on Linux MIPS the cast result is 255. This
diff changes the code to use an explicit Ecmascript ToInteger() cast which
handles NaN specially and guarantees a zero result.
- Add -m32, -mx32
- Support parallel runs by dynamic temp names (still pretty hacky)
- Add more compilers and compiler versions
- Add more dialects
- Add more optimization levels
There are some matrix test failures with older compilers, especially
clang/llvm-gcc with -m32 (same double union failure as in FreeBSD 10
clang 3.3 -m32).
This fixes an OSX _setjmp() related crash reported by Andreas Oman.
"volatile int *x" is a non-volatile pointer to a volatile int value.
"int * volatile x" is a volatile pointer to a non-volatile int value.
For pointers that may get reassigned, the latter is correct.
Also add a few asserts.
Add userdata pointer to heap pointer compression macros
(DUK_OPT_HEAPPTR_ENC16, DUK_OPT_HEAPPTR_DEC16) and external string
macros (DUK_OPT_EXTSTR_INTERN_CHECK, DUK_OPT_EXTSTR_FREE).
The userdata allows an application to use pointer compression and external
strings for multiple heaps with different base memory pointers. If there
is less than 256kB RAM total on the device, the userdata can be ignored.
Duktape debug print code doesn't currently have access to 'heap' or 'thr'
so it cannot decode heap pointers with userdata. For now, debug printing
cannot be enabled when pointer compression is active.
Also remove mostly unused old debug code.
Debug code doesn't have access to 'heap' so it cannot decode pointers.
Cause an #error for now if both debug prints and pointer compression
are enabled at the same time.
Remove duk_debug_hobject.c from make and dist. It was out of date and
not used in practice anymore.
- Avoid warning for unreferenced variables
- Fix incorrect (non-existent) macro name (DUK_NEVER_HERE)
- Fix built-in missing prototype
- Fix C++ static variable issue
- Avoid pc2line lookup when not enabled
- Change combine_src.py order to match C++ static var requirements
- Use volatile in cause segfault to avoid clang warning
Reimplement matrix testing to support proper combination structure like
Select, Combine, Subset, etc. Avoid enumerating the matrix explicitly,
and change testing to use random sampling of the (very large) matrix space.
Improve the testing matrix to include a lot more option combinations. The
set is still not complete and output is not yet warning free with all options
so '-Werror' is not yet enabled in the matrix.
Add convenience Makefile targets like 'matrix10', 'matrix100', etc so that
small matrix tests can be easily run while developing.