From 848568790826b7e201f84682185b5b605c473016 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 7 Jul 2025 15:03:45 -0300 Subject: Correction in definition of CIST_FRESH The cast must be made before the shift. If int has 16 bits, the shift would zero the value and the cast would cast 0 to 0. --- lstate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lstate.h b/lstate.h index f841c232..80df3b0a 100644 --- a/lstate.h +++ b/lstate.h @@ -85,7 +85,7 @@ typedef struct CallInfo CallInfo; ** they must be visited again at the end of the cycle), but they are ** marked black because assignments to them must activate barriers (to ** move them back to TOUCHED1). -** - Open upvales are kept gray to avoid barriers, but they stay out +** - Open upvalues are kept gray to avoid barriers, but they stay out ** of gray lists. (They don't even have a 'gclist' field.) */ @@ -232,7 +232,7 @@ struct CallInfo { /* call is running a C function (still in first 16 bits) */ #define CIST_C (1u << (CIST_RECST + 3)) /* call is on a fresh "luaV_execute" frame */ -#define CIST_FRESH cast(l_uint32, CIST_C << 1) +#define CIST_FRESH (cast(l_uint32, CIST_C) << 1) /* function is closing tbc variables */ #define CIST_CLSRET (CIST_FRESH << 1) /* function has tbc variables to close */ -- cgit v1.2.3-55-g6feb