Skip to content

Commit ef9ad40

Browse files
authored
Fix cores.test_minimal_runtime_safe_heap (#23423)
This test was broken after #23403 because an `@export` comment that was associated with deleted symbol/node got incorrectly matches with the following symbol/node. Not the most satisfactory fix but its seems work. Fixes: #23422
1 parent 16d389c commit ef9ad40

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ jobs:
566566
core2ss.test_pthread_thread_local_storage
567567
core2s.test_dylink_syslibs_missing_assertions
568568
core2s.test_module_wasm_memory
569+
cores.test_minimal_runtime_safe_heap
569570
wasm2js3.test_memorygrowth_2
570571
wasmfs.test_hello_world
571572
wasmfs.test_unistd_links*

tools/acorn-optimizer.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,10 +1958,10 @@ function reattachComments(ast, commentsMap) {
19581958
trace('dropping comments: no symbol comes after them');
19591959
break;
19601960
}
1961-
if (symbols[j].start.pos - pos > 20) {
1962-
// This comment is too far away to refer to the given symbol. Drop
1963-
// the comment altogether.
1964-
trace('dropping comments: too far from any symbol');
1961+
if (symbols[j].start.pos != pos) {
1962+
// This comment must have been associated with a node that still
1963+
// exists in the AST, otherwise to drop it.
1964+
trace('dropping comments: not linked to any remaining AST node');
19651965
continue;
19661966
}
19671967
symbols[j].start.comments_before ??= [];

0 commit comments

Comments
 (0)