Stack indices changed to union's

That will allow to change pointers to offsets while reallocating
the stack.
This commit is contained in:
Roberto Ierusalimschy
2022-10-29 12:06:37 -03:00
parent ba089bcb08
commit 413a393e62
19 changed files with 384 additions and 370 deletions

View File

@@ -157,6 +157,12 @@ typedef union StackValue {
/* index to stack elements */
typedef StackValue *StkId;
typedef union {
StkId p; /* actual pointer */
} StkIdRel;
/* convert a 'StackValue' to a 'TValue' */
#define s2v(o) (&(o)->val)
@@ -618,7 +624,9 @@ typedef struct Proto {
typedef struct UpVal {
CommonHeader;
lu_byte tbc; /* true if it represents a to-be-closed variable */
TValue *v; /* points to stack or to its own value */
union {
TValue *p; /* points to stack or to its own value */
} v;
union {
struct { /* (when open) */
struct UpVal *next; /* linked list */