mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-30 07:14:39 +08:00
Keep the stack guard out of localized library archives
The stack guard was a tentative definition, which some targets emit as a common symbol. Localized library archives deliberately leave common symbols shared, so on macOS the archive defined scr_stack_guard alongside its declared exports. An explicit initializer makes it an ordinary definition that localization hides like the rest of the runtime.
This commit is contained in:
@@ -56,8 +56,10 @@ ScrExcCell *scr_exc_active = &scr_main_exc;
|
||||
|
||||
/* The running stack's overflow guard (scr_runtime.h). It lives beside the
|
||||
* exception cell so fiber switching can maintain it whenever scr_async.c is
|
||||
* linked; scr_context.c installs it per thread. */
|
||||
SCR_TL uintptr_t scr_stack_guard;
|
||||
* linked; scr_context.c installs it per thread. The explicit initializer
|
||||
* keeps it an ordinary definition rather than a common symbol, which a
|
||||
* localized library archive would otherwise leave shared. */
|
||||
SCR_TL uintptr_t scr_stack_guard = 0;
|
||||
|
||||
/* Fiber switching (scr_async.c) points the exception machinery at the
|
||||
* incoming fiber's cell; returns the previous cell. */
|
||||
|
||||
Reference in New Issue
Block a user