var stdlib = {};
var foreign = {};
var heap = new ArrayBuffer(64 * 1024);
var mod = function Module(stdlib, foreign, heap) {
'use asm';
function mod(dividend, divisor) {
dividend = dividend | 0;
divisor = divisor | 0;
return (dividend | 0) % (divisor | 0) | 0;
}
return {
mod: mod
};
}(stdlib, foreign, heap).mod;
var divisors = [
-2147483648,
-32 * 1024,
-1000,
-16,
-7,
-2,
-1,
0,
1,
3,
4,
10,
64,
100,
1024,
2147483647
];
for (var i in divisors) {
var divisor = divisors[i];
for (var dividend = -2147483648; dividend < 2147483648; dividend += 3999773) {
print(dividend % divisor | 0, mod(dividend, divisor));
}
}
description
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1941769==ERROR: AddressSanitizer: FPE on unknown address 0x000000773e98 (pc 0x000000773e98 bp 0x7ffd3c245b70 sp 0x7ffd3c245440 T0)
#0 0x773e98 in fxRunID /home/sakura/moddable/xs/sources/xsRun.c:3395:27
#1 0x78f93f in fxRunScript /home/sakura/moddable/xs/sources/xsRun.c:4752:4
#2 0x909474 in fxRunProgramFile /home/sakura/moddable/xs/tools/xst.c:1387:2
#3 0x909474 in main /home/sakura/moddable/xs/tools/xst.c:281:8
#4 0x7f83acdd00b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#5 0x42e69d in _start (/home/sakura/moddable/build/bin/lin/release/xst+0x42e69d)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /home/sakura/moddable/xs/sources/xsRun.c:3395:27 in fxRunID
==1941769==ABORTING
Build environment
poc
description