aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/JSBackend
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-12 21:30:44 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-12 21:30:44 -0800
commitffc5813072714b31d2bcd7ab92a95f36fe1e01f6 (patch)
treece36ae92daaa08eb35cee945527a7801c11391dd /lib/Target/JSBackend
parent90a3c06f7d31cc7649e74b9c0269f366f7b84437 (diff)
handle preinvoke/postinvoke pairs where the call in the middle was optimized out; helps #5
Diffstat (limited to 'lib/Target/JSBackend')
-rw-r--r--lib/Target/JSBackend/CallHandlers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h
index 1f63ca9715..d01ae804fc 100644
--- a/lib/Target/JSBackend/CallHandlers.h
+++ b/lib/Target/JSBackend/CallHandlers.h
@@ -110,7 +110,7 @@ DEF_CALL_HANDLER(emscripten_preinvoke, {
return "__THREW__ = 0";
})
DEF_CALL_HANDLER(emscripten_postinvoke, {
- assert(InvokeState == 2);
+ assert(InvokeState == 1 || InvokeState == 2); // normally 2, but can be 1 if the call in between was optimized out
InvokeState = 0;
return getAssign(getJSName(CI), CI->getType()) + "__THREW__; __THREW__ = 0";
})