Rename memory instructions; Rework constant handling

This commit is contained in:
dcodeIO
2018-07-18 23:49:32 +02:00
parent 34e8facfdc
commit a1b75b69b7
170 changed files with 26392 additions and 5185 deletions

View File

@ -25,14 +25,18 @@ function test(file) {
console.log("mem final: " + exports.memory.buffer.byteLength);
console.log();
const alloc = exports["memory.allocate"];
var overflow = false;
try {
exports.allocate_memory(COMMON_MAX + 1); // unreachable
throw Error("allocation is allowed to overflow MAX_SIZE");
alloc(COMMON_MAX + 1); // unreachable
overflow = true;
} catch (e) {}
if (overflow) throw Error("allocation can overflow COMMON_MAX + 1");
try {
exports.allocate_memory(0xffffffff); // unreachable
throw Error("allocation is allowed to overflow INT_MAX");
alloc(0xffffffff); // unreachable
overflow = true;
} catch (e) {}
if (overflow) throw Error("allocation can overflow 0xffffffff");
}
if (process.argv.length > 2) {