Skip to content

Change an assertion to an error when the emterpreter data is missing #5653

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

Merged
merged 2 commits into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -315,5 +315,6 @@ a license to everyone to use it as detailed in LICENSE.)
* Jiajie Hu <[email protected]> (copyright owned by Intel Corporation)
* Kamil Klimek <[email protected]>
* José Carlos Pujol <josecpujol(at)gmail.com>
* Dannii Willis <[email protected]>


4 changes: 3 additions & 1 deletion tools/emterpretify.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,9 @@ def post_process_code(code):

js += ['''
var bytecodeFile = Module['emterpreterFile'];
assert(bytecodeFile instanceof ArrayBuffer, 'bad or missing emterpreter file. if you compiled to JS (and not HTML) make sure you set Module["emterpreterFile"]');
if (!(bytecodeFile instanceof ArrayBuffer)) {
throw "bad or missing emterpreter file. If you compiled to JS (and not HTML) make sure you set Module['emterpreterFile']";
}
var codeSize = %d;
HEAPU8.set(new Uint8Array(bytecodeFile).subarray(0, codeSize), eb);
assert(HEAPU8[eb] === %d);
Expand Down