Skip to content

Commit 0c2862c

Browse files
committed
Prevent constant-folding of linked global, table, and memory addresses since they may be reinitialized.
1 parent dcc362c commit 0c2862c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/RuntimeState.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public abstract class RuntimeState {
7979
* module-specific, and the globals can be imported across modules. Thus, the address-space of
8080
* the globals is not the same as the module-specific index-space.
8181
*/
82-
@CompilationFinal(dimensions = 1) private int[] globalAddresses;
82+
@CompilationFinal(dimensions = 0) private int[] globalAddresses;
8383

8484
/**
8585
* This array is monotonically populated from the left. An index i denotes the i-th table in
@@ -90,9 +90,9 @@ public abstract class RuntimeState {
9090
* module-specific, and the tables can be imported across modules. Thus, the address-space of
9191
* the tables is not the same as the module-specific index-space.
9292
*/
93-
@CompilationFinal(dimensions = 1) private int[] tableAddresses;
93+
@CompilationFinal(dimensions = 0) private int[] tableAddresses;
9494

95-
@CompilationFinal(dimensions = 1) private WasmMemory[] memories;
95+
@CompilationFinal(dimensions = 0) private WasmMemory[] memories;
9696

9797
/**
9898
* The passive elem instances that can be used to lazily initialize tables. They can potentially

0 commit comments

Comments
 (0)