Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion src/parseTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,11 @@ function makeSetValue(ptr, pos, value, type, noNeedFirst, ignore, align, sep = '
return '(' + makeSetTempDouble(0, 'double', value) + ',' +
makeSetValue(ptr, pos, makeGetTempDouble(0, 'i32'), 'i32', noNeedFirst, ignore, align, ',') + ',' +
makeSetValue(ptr, getFastValue(pos, '+', Runtime.getNativeTypeSize('i32')), makeGetTempDouble(1, 'i32'), 'i32', noNeedFirst, ignore, align, ',') + ')';
} else if (!WASM_BIGINT && type == 'i64') {
} else if (type == 'i64' && (!WASM_BIGINT || !MEMORY64)) {
// If we lack either BigInt support or Memory64 then we must fall back to an
// unaligned read of a 64-bit value: without BigInt we do not have HEAP64,
// and without Memory64 i64 fields are not guaranteed to be aligned to 64
// bits, so HEAP64[ptr>>3] might be broken.
return '(tempI64 = [' + splitI64(value) + '],' +
makeSetValue(ptr, pos, 'tempI64[0]', 'i32', noNeedFirst, ignore, align, ',') + ',' +
makeSetValue(ptr, getFastValue(pos, '+', Runtime.getNativeTypeSize('i32')), 'tempI64[1]', 'i32', noNeedFirst, ignore, align, ',') + ')';
Expand Down
3 changes: 3 additions & 0 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5290,6 +5290,9 @@ def test(args):
'main_thread': (['-sPTHREAD_POOL_SIZE=5'],),
# using proxy_to_pthread also works, of course
'proxy_to_pthread': (['-sPROXY_TO_PTHREAD', '-sINITIAL_MEMORY=32MB', '-DPROXYING'],),
# using BigInt support affects the ABI, and should not break things. (this
# could be tested on either thread; do the main thread for simplicity)
'bigint': (['-sPTHREAD_POOL_SIZE=5', '-sWASM_BIGINT'],),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we modify test/other/test_parseTools.js to test this fix more directly/precisely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test there now.

})
@requires_threads
def test_wasmfs_fetch_backend(self, args):
Expand Down