Skip to content

Commit ef54f01

Browse files
committed
QuickJS: Update header from CHOC upstream, and disable CONFIG_STACK_CHECK
The CONFIG_STACK_CHECK option doesn't work correctly when the QuickJS engine is initialised on one thread and then later accessed by another thread, which is a usage pattern implicitly supported by JUCE.
1 parent 9715b90 commit ef54f01

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modules/juce_javascript/choc/javascript/choc_javascript_QuickJS.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9428,9 +9428,8 @@ int JS_SetModuleExportList(JSContext *ctx, JSModuleDef *m,
94289428
//#define CONFIG_ATOMICS
94299429
#endif
94309430

9431-
#if ! (defined(EMSCRIPTEN) || _MSC_VER)
9432-
/* enable stack limitation */
9433-
#define CONFIG_STACK_CHECK
9431+
#if ! (defined(EMSCRIPTEN) || CHOC_QUICKJS_NO_STACK_CHECK || _MSC_VER)
9432+
#define CONFIG_STACK_CHECK
94349433
#endif
94359434

94369435
// Avoid enabling the stack check if the sanitiser is active, as it causes all

modules/juce_javascript/juce_javascript.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#undef CONFIG_BIGNUM
4949
#endif
5050

51+
#define CHOC_QUICKJS_NO_STACK_CHECK 1
52+
5153
#define choc juce::detail::choc
5254
#include <juce_javascript/choc/javascript/choc_javascript_QuickJS.h>
5355
#undef choc

0 commit comments

Comments
 (0)