From 413a393e6222482f46599e138bebac162610a572 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 29 Oct 2022 12:06:37 -0300 Subject: Stack indices changed to union's That will allow to change pointers to offsets while reallocating the stack. --- lobject.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 77cc606f..7af7bd89 100644 --- a/lobject.h +++ b/lobject.h @@ -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 */ -- cgit v1.2.3-55-g6feb