You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnoutput+'\nThis error happened during an emterpreter-async save or load of the stack. Was there non-emterpreted code on the stack during save (which is unallowed)? You may want to adjust EMTERPRETIFY_BLACKLIST, EMTERPRETIFY_WHITELIST, or EMTERPRETIFY_YIELDLIST (to consider certain functions ok to run during an emscripten_sleep_with_yield).\nThis is what the stack looked like when we tried to save it: '+[EmterpreterAsync.state,EmterpreterAsync.saveStack];
225
+
returnoutput+'\nThis error happened during an emterpreter-async save or load of the stack. Was there non-emterpreted code on the stack during save (which is unallowed)? You may want to adjust EMTERPRETIFY_BLACKLIST, EMTERPRETIFY_WHITELIST.\nThis is what the stack looked like when we tried to save it: '+[EmterpreterAsync.state,EmterpreterAsync.saveStack];
Copy file name to clipboardExpand all lines: tools/js-optimizer.js
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -5754,7 +5754,6 @@ function emterpretify(ast) {
5754
5754
varASYNC=extraInfo.ASYNC;
5755
5755
varPROFILING=extraInfo.PROFILING;
5756
5756
varASSERTIONS=extraInfo.ASSERTIONS;
5757
-
varyieldFuncs=set(extraInfo.yieldFuncs);
5758
5757
5759
5758
varRELATIVE_BRANCHES=set('BR','BRT','BRF');
5760
5759
varABSOLUTE_BRANCHES=set('BRA','BRTA','BRFA');
@@ -5782,6 +5781,14 @@ function emterpretify(ast) {
5782
5781
returnArray.prototype.slice.call(tempUint8,0,8);
5783
5782
}
5784
5783
5784
+
varOK_TO_CALL_WHILE_ASYNC=set('stackSave','stackRestore','stackAlloc','setThrew','_memset');// functions which are ok to run while async, even if not emterpreted
5785
+
functionokToCallWhileAsync(name){
5786
+
// dynCall *can* be on the stack, they are just bridges; what matters is where they go
// we need to be careful to never enter non-emterpreted code while doing an async save/restore,
7042
7049
// which is what happens if non-emterpreted code is on the stack while we attempt to save.
7043
-
// note that we special-case dynCall, which *can* be on the stack, they are just bridges; what
7044
-
// matters is where they go
7045
-
7046
7050
// add asserts right after each call
7047
7051
varstack=[];
7048
7052
traverse(func,function(node,type){
@@ -7251,10 +7255,6 @@ function emterpretify(ast) {
7251
7255
});
7252
7256
if(ASYNC){
7253
7257
argStats.push(['if',srcToExp('(asyncState|0) == 1'),srcToStat('asyncState = 3;')]);// we know we are during a sleep, mark the state
7254
-
if(ASSERTIONS&&!(func[1]inyieldFuncs)){
7255
-
argStats.push(['if',srcToExp('((asyncState|0) == 1) | ((asyncState|0) == 3)'),srcToStat('abort(-12) | 0')]);// if *not* a yield func, we should never get here (trampoline entry)
7256
-
// while sleeping (3, or 1 which has not yet been turned into a 3)
7257
-
}
7258
7258
argStats=[['if',srcToExp('(asyncState|0) != 2'),['block',argStats]]];// 2 means restore, so do not trample the stack
0 commit comments