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
// Endianness check (note: assumes compiler arch was little-endian)
(function(){
varh16=newInt16Array(1);
varh8=newInt8Array(h16.buffer);
h16[0]=0x6373;
if(h8[0]!==0x73||h8[1]!==0x63)throw'Runtime error: expected the system to be little-endian!';
})();
functionabortFnPtrError(ptr,sig){
#if ASSERTIONS>=2
varpossibleSig='';
for(varxindebug_tables){
vartbl=debug_tables[x];
if(tbl[ptr]){
possibleSig+='as sig "'+x+'" pointing to function '+tbl[ptr]+', ';
}
}
abort("Invalid function pointer "+ptr+" called with signature '"+sig+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). This pointer might make sense in another type signature: "+possibleSig);
#else
abort("Invalid function pointer "+ptr+" called with signature '"+sig+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with ASSERTIONS=2 for more info.");