Skip to content

Commit 62ad88a

Browse files
committed
api-test: workaround clang bug
1 parent f68504b commit 62ad88a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api-test.c

+7
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ static void async_call_stack_overflow(void)
9696

9797
JSRuntime *rt = JS_NewRuntime();
9898
JSContext *ctx = JS_NewContext(rt);
99+
#if !defined(__clang__) || defined(__OPTIMIZE__)
100+
#if !__has_feature(undefined_behavior_sanitizer) && !__has_feature(memory_sanitizer)
101+
// TODO: check why this fails under clang -O0 + ubsan/msan
102+
JS_SetMaxStackSize(rt, 128 * 1024);
103+
JS_UpdateStackTop(rt);
104+
#endif
105+
#endif
99106
JSValue value = JS_UNDEFINED;
100107
JS_SetContextOpaque(ctx, &value);
101108
JSValue global = JS_GetGlobalObject(ctx);

0 commit comments

Comments
 (0)