Skip to content

Commit 49b7ec3

Browse files
committed
To be removed: test compiler using "--uncheckedBehavior always"
For some reason, the Wasm variant fails to bootstrap. Specifically, when compiling the first function that is compiled, which happens to be ~lib/rt/common/OBJECT#get:rtSize. The JS variant sees that a local is present, but the Wasm variant does not. Hence, the compiler crashes by making a negative-length array in Function#getNonParameterLocalTypes(). This commit simply demonstrates this issue in CI.
1 parent 809a4d4 commit 49b7ec3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/asconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"initialMemory": 768,
1010
"runtime": "incremental",
1111
"bindings": [ "esm" ],
12+
"uncheckedBehavior": "always",
1213
"stats": true
1314
},
1415
"targets": {
@@ -44,4 +45,4 @@
4445
"shrinkLevel": 0
4546
}
4647
}
47-
}
48+
}

tests/compiler.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import glob from "glob";
99
import { stderrColors, stdoutColors } from "../util/terminal.js";
1010
import * as optionsUtil from "../util/options.js";
1111
import { coreCount, threadCount } from "../util/cpu.js";
12-
import { diff } from "../util/text.js";
12+
// import { diff } from "../util/text.js";
1313
import { Rtrace } from "../lib/rtrace/index.js";
1414
import asc from "../dist/asc.js";
1515

@@ -184,6 +184,7 @@ async function runTest(basename) {
184184
basename + ".ts",
185185
"--baseDir", basedir,
186186
"--debug",
187+
"--uncheckedBehavior", "always",
187188
"--textFile" // -> stdout
188189
];
189190
if (asc_flags) cmd.push(...asc_flags);
@@ -232,11 +233,11 @@ async function runTest(basename) {
232233

233234
const compareFixture = section("compare fixture");
234235
const actual = stdout.toString().replace(/\r\n/g, "\n");
235-
if (args.create) {
236+
{
236237
fs.writeFileSync(path.join(basedir, basename + ".debug.wat"), actual, { encoding: "utf8" });
237238
console.log(" " + stdoutColors.yellow("Created fixture"));
238239
compareFixture.end(SKIPPED);
239-
} else {
240+
} /* else {
240241
const expected = fs.readFileSync(path.join(basedir, basename + ".debug.wat"), { encoding: "utf8" }).replace(/\r\n/g, "\n");
241242
if (args.noDiff) {
242243
if (expected != actual) {
@@ -252,7 +253,7 @@ async function runTest(basename) {
252253
}
253254
}
254255
compareFixture.end(SUCCESS);
255-
}
256+
} */
256257
}
257258

258259
stdout.length = 0;
@@ -266,11 +267,12 @@ async function runTest(basename) {
266267
const cmd = [
267268
basename + ".ts",
268269
"--baseDir", basedir,
270+
"--uncheckedBehavior", "always",
269271
"--outFile", // -> stdout
270272
"-O"
271273
];
272274
if (asc_flags) cmd.push(...asc_flags);
273-
if (args.create) cmd.push("--textFile", basename + ".release.wat");
275+
/* if (true) */ cmd.push("--textFile", basename + ".release.wat");
274276
if (args.noColors) cmd.push("--noColors");
275277
const compileRelease = section("compile release");
276278
const { error } = await asc.main(cmd, { stdout: stdout, stderr: stderr });
@@ -315,6 +317,7 @@ async function runTest(basename) {
315317
"--baseDir", basedir,
316318
"--outFile", // -> stdout
317319
"--debug",
320+
"--uncheckedBehavior", "always",
318321
"--use", "ASC_RTRACE=1",
319322
"--exportStart", "_initialize",
320323
// "--runPasses", "instrument-memory"

0 commit comments

Comments
 (0)