@@ -295,7 +295,10 @@ var LibraryDylink = {
295295 // Detect immutable wasm global exports. These represent data addresses
296296 // which are relative to `memoryBase`. `mutableGlobals`, when known,
297297 // saves probing each global.
298- if ( mutableGlobals ? value instanceof WebAssembly . Global && ! mutableGlobals . has ( name ) : isImmutableGlobal ( value ) ) {
298+ var immutable = mutableGlobals
299+ ? value instanceof WebAssembly . Global && ! mutableGlobals . has ( name )
300+ : isImmutableGlobal ( value ) ;
301+ if ( immutable ) {
299302 return new WebAssembly . Global ( { 'value' : '{{{ POINTER_WASM_TYPE }}}' } , value . value + { { { to64 ( 'memoryBase' ) } } } ) ;
300303 }
301304
@@ -496,8 +499,9 @@ var LibraryDylink = {
496499
497500 function skipLimits ( ) {
498501 var flags = getU8 ( ) ;
499- getLEB ( ) ;
500- if ( flags & 1 ) getLEB ( ) ;
502+ getLEB ( ) ; // min
503+ if ( flags & 1 ) getLEB ( ) ; // max
504+ if ( flags & 8 ) getLEB ( ) ; // page size (custom-page-sizes)
501505 }
502506
503507 while ( offset < binary . length ) {
@@ -525,7 +529,7 @@ var LibraryDylink = {
525529 if ( op === 0x43 ) offset += 4 ; // f32.const
526530 else if ( op === 0x44 ) offset += 8 ; // f64.const
527531 // i32.const, i64.const, global.get, ref.null, ref.func
528- else if ( [ 0x41 , 0x42 , 0x23 , 0xd0 , 0xd2 ] . includes ( op ) ) getLEB ( ) ;
532+ else if ( op === 0x41 || op === 0x42 || op === 0x23 || op === 0xd0 || op === 0xd2 ) getLEB ( ) ;
529533 // Anything but the extended-const add, sub and mul instructions
530534 else if ( ! ( op >= 0x6a && op <= 0x6c || op >= 0x7c && op <= 0x7e ) ) return ;
531535 }
0 commit comments