Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/library_dylink.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ var LibraryDylink = {
end = binary.length
} else {
var int32View = new Uint32Array(new Uint8Array(binary.subarray(0, 24)).buffer);
failIf(int32View[0] != 0x6d736100, 'need to see wasm magic number'); // \0asm
#if SUPPORT_BIG_ENDIAN
var magicNumberFound = int32View[0] == 0x6d736100 || int32View[0] == 0x0061736d;
#else
var magicNumberFound = int32View[0] == 0x6d736100;
#endif
failIf(!magicNumberFound, 'need to see wasm magic number'); // \0asm
// we should see the dylink custom section right after the magic number and wasm version
failIf(binary[8] !== 0, 'need the dylink section to be first')
offset = 9;
Expand Down