E.g. if during evaluation of module A, we start loading module B and
an error occurs. This results in a call to js_free_modules() with
JS_FREE_MODULE_NOT_EVALUATED, and since module A isn't yet evaluated,
it gets freed prematurely.
To solve this we improve js_free_modules() to ensure `eval_mark` is not
set. Once js_evaluate_module() returns for module A, it will notice that
an exception occurred and call js_free_modules() with
JS_FREE_MODULE_NOT_EVALUATED. Since `eval_mark` has been cleared by then,
module A gets cleaned up as well.
Co-authored-by: Ole André Vadla Ravnås <oleavr@gmail.com>
MemorySanitizer complained about uninitialized reads in
the indexed property code path in JS_GetPropertyValue()
with JS_CLASS_MAPPED_ARGUMENTS objects.
Compare against 0x1p63 instead of INT64_MAX. Converting INT64_MAX to
double rounds it up to INT64_MAX+1.
It made code like `if (d <= INT64_MAX) v = (int64_t)d;` behave subtly
wrong when `d >= 0x1p63` because then `v = (int64_t)d` wraps around to
a negative value.