Skip to content

Commit 0e2e92c

Browse files
leifericfclaude
andcommitted
v0.144.3: drop unused local in mino_current_ctx to satisfy gcc
After v0.144.2 fixed the env/rest clobber warnings, gcc still flagged the inline mino_current_ctx's local t when it expanded into mino_bc_run's setjmp scope. The local was a single read of mino_tls_ctx feeding a ternary; removing it makes the body a direct conditional on the TLS variable, which silences the false-positive warning. Generated code is unchanged on Apple clang and gcc 12. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4e6dc98 commit 0e2e92c

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## v0.144.3 — Build Fix: Drop Local In `mino_current_ctx`
4+
5+
gcc's `-Werror=clobbered` flagged the local `t` in
6+
`mino_current_ctx`'s inlined body when the inline expansion
7+
landed in a function with a `setjmp`. The local was a single
8+
unused-after-assignment cache (`mino_thread_ctx_t *t =
9+
mino_tls_ctx;` followed by a ternary), so the warning was a
10+
false positive — but `-Werror` made it fatal anyway. Removed
11+
the local; the body is now a direct ternary on `mino_tls_ctx`.
12+
The compiler is free to load the TLS slot once; there is no
13+
observable change in generated code on either Apple clang or
14+
gcc 12.
15+
316
## v0.144.2 — Build Fix: Mark setjmp-Adjacent Locals `volatile`
417

518
GCC's `-Werror=clobbered` flagged three locals in `mino_bc_run`

src/mino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
#define MINO_VERSION_MAJOR 0
3030
#define MINO_VERSION_MINOR 144
31-
#define MINO_VERSION_PATCH 2
31+
#define MINO_VERSION_PATCH 3
3232

3333
/*
3434
* Human-readable version string of the *linked* runtime, e.g. "0.48.0".

src/runtime/internal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,7 @@ struct mino_state {
10631063
* is a TLS load + predictable branch. */
10641064
static inline mino_thread_ctx_t *mino_current_ctx(mino_state_t *S)
10651065
{
1066-
mino_thread_ctx_t *t = mino_tls_ctx;
1067-
return t != NULL ? t : &S->main_ctx;
1066+
return mino_tls_ctx != NULL ? mino_tls_ctx : &S->main_ctx;
10681067
}
10691068

10701069
/* ------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)