> clang-18 -fsanitize=undefined ubsan_test.c build/libqjs.a -lm -o ubsan_test
> ./ubsan_test
/quickjs/cutils.c:124:19: runtime error: call to function js_realloc_rt through pointer to incorrect function type 'void *(*)(void *, void *, unsigned long)'
(/quickjs/ubsan_test+0xa7f40): note: js_realloc_rt defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /quickjs/cutils.c:124:19
Building quickjs-ng with
clang-18
and-DCONFIG_UBSAN=ON
, the following dummy program gives a UBSAN error: