Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit ab56f0a

Browse files
committed
receive MAX_SETJMPS from emscripten; 1.18.4
1 parent 2eb19a3 commit ab56f0a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

emscripten-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.18.3
1+
1.18.4
22

lib/Target/JSBackend/CallHandlers.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ DEF_CALL_HANDLER(emscripten_resume, {
162162
// setjmp support
163163

164164
DEF_CALL_HANDLER(emscripten_prep_setjmp, {
165-
return getAdHocAssign("_setjmpTable", Type::getInt32Ty(CI->getContext())) + "STACKTOP; STACKTOP=(STACKTOP+168)|0;" + // XXX FIXME
165+
return getAdHocAssign("_setjmpTable", Type::getInt32Ty(CI->getContext())) + "STACKTOP; STACKTOP=(STACKTOP+" + utostr(4 * 2 * (MaxSetjmps+1)) + ")|0;" +
166166
"HEAP32[_setjmpTable>>2]=0";
167167
})
168168
DEF_CALL_HANDLER(emscripten_setjmp, {

lib/Target/JSBackend/JSBackend.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ NoAliasingFunctionPointers("emscripten-no-aliasing-function-pointers",
8888
cl::desc("Forces function pointers to not alias (this is more correct, but rarely needed, and has the cost of much larger function tables; it is useful for debugging though; see emscripten ALIASING_FUNCTION_POINTERS option)"),
8989
cl::init(false));
9090

91+
static cl::opt<int>
92+
MaxSetjmps("emscripten-max-setjmps",
93+
cl::desc("Maximum amount of setjmp() calls per function stack frame (see emscripten MAX_SETJMPS)"),
94+
cl::init(20));
95+
9196
extern "C" void LLVMInitializeJSBackendTarget() {
9297
// Register the target.
9398
RegisterTargetMachine<JSTargetMachine> X(TheJSBackendTarget);

0 commit comments

Comments
 (0)