-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
side module calls main module with a 64bit param #8291
Changes from all commits
aac4d8a
90c0b07
e37f083
67185f0
bb46d38
3128f52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright 2019 The Emscripten Authors. All rights reserved. | ||
* Emscripten is available under two separate licenses, the MIT license and the | ||
* University of Illinois/NCSA Open Source License. Both these licenses can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include <cstdint> | ||
#include <emscripten.h> | ||
|
||
extern "C"{ | ||
extern void passBigInt(uint64_t); | ||
} | ||
EMSCRIPTEN_KEEPALIVE void callPassBigInt(){ | ||
passBigInt(1152921504606846975); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8102,6 +8102,13 @@ def test_no_legalize_js_ffi(self): | |
e_legalstub_i32 = re.search('\(func.*\$legalstub\$dyn.*\(type \$\d+\).*\(result i32\)', text) | ||
assert i_legalimport_i64, 'legal import not generated for invoke call' | ||
assert e_legalstub_i32, 'legal stub not generated for dyncall' | ||
args = ['-s', 'LEGALIZE_JS_FFI=0', '-s', 'SIDE_MODULE=1', '-O3', '-s', 'DISABLE_EXCEPTION_CATCHING=0'] | ||
print(args) | ||
cmd = [PYTHON, EMCC, path_from_root('tests', 'other', 'noffi-side.cpp'), '-g', '-o', 'side.wasm'] + args | ||
print(' '.join(cmd)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do see this fail in the node command, with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kripken sorry about that. i have pushed a fix to the test so it fails properly now. the error is |
||
run_process(cmd) | ||
ret = run_process(NODE_JS + ['a.out.js'], stdout=PIPE).stdout | ||
self.assertContained('1152921504606846975', ret) | ||
|
||
def test_sysconf_phys_pages(self): | ||
for args, expected in [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we expect that this would get translated into a call_indirect, but this gets translated into a $env._passBigInt instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indirection here is handled on the JS side. The imported function is a JS stub that gets filled in as symbols are resolved by loading modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right and this JS stub is causing problems when we turn off JS legalization.