File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,13 +223,6 @@ function integrateWasmJS(Module) {
223223 env [ 'memory' ] = providedBuffer ;
224224 assert ( env [ 'memory' ] instanceof ArrayBuffer ) ;
225225
226- if ( ! ( 'memoryBase' in env ) ) {
227- env [ 'memoryBase' ] = STATIC_BASE ; // tell the memory segments where to place themselves
228- }
229- if ( ! ( 'tableBase ' in env ) ) {
230- env [ 'tableBase '] = 0 ; // tell the memory segments where to place themselves
231- }
232-
233226 wasmJS [ 'providedTotalMemory' ] = Module [ 'buffer' ] . byteLength ;
234227
235228 // Prepare to generate wasm, using either asm2wasm or s-exprs
@@ -297,6 +290,13 @@ function integrateWasmJS(Module) {
297290 env [ 'table' ] = new Array ( TABLE_SIZE ) ; // works in binaryen interpreter at least
298291 }
299292 }
293+
294+ if ( ! env [ 'memoryBase' ] ) {
295+ env [ 'memoryBase' ] = STATIC_BASE ; // tell the memory segments where to place themselves
296+ }
297+ if ( ! env [ 'tableBase' ] ) {
298+ env [ 'tableBase' ] = 0 ; // table starts at 0 by default, in dynamic linking this will change
299+ }
300300
301301 // try the methods. each should return the exports if it succeeded
302302
You can’t perform that action at this time.
0 commit comments