diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-10-29 12:06:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-10-29 12:06:37 -0300 |
commit | 413a393e6222482f46599e138bebac162610a572 (patch) | |
tree | 181517f8ec8d56f9101de33f4891729044f244de /lobject.h | |
parent | ba089bcb08a0efc6c26fb5c1e3c9d61c00cc012c (diff) | |
download | lua-413a393e6222482f46599e138bebac162610a572.tar.gz lua-413a393e6222482f46599e138bebac162610a572.tar.bz2 lua-413a393e6222482f46599e138bebac162610a572.zip |
Stack indices changed to union's
That will allow to change pointers to offsets while reallocating
the stack.
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -157,6 +157,12 @@ typedef union StackValue { | |||
157 | /* index to stack elements */ | 157 | /* index to stack elements */ |
158 | typedef StackValue *StkId; | 158 | typedef StackValue *StkId; |
159 | 159 | ||
160 | |||
161 | typedef union { | ||
162 | StkId p; /* actual pointer */ | ||
163 | } StkIdRel; | ||
164 | |||
165 | |||
160 | /* convert a 'StackValue' to a 'TValue' */ | 166 | /* convert a 'StackValue' to a 'TValue' */ |
161 | #define s2v(o) (&(o)->val) | 167 | #define s2v(o) (&(o)->val) |
162 | 168 | ||
@@ -618,7 +624,9 @@ typedef struct Proto { | |||
618 | typedef struct UpVal { | 624 | typedef struct UpVal { |
619 | CommonHeader; | 625 | CommonHeader; |
620 | lu_byte tbc; /* true if it represents a to-be-closed variable */ | 626 | lu_byte tbc; /* true if it represents a to-be-closed variable */ |
621 | TValue *v; /* points to stack or to its own value */ | 627 | union { |
628 | TValue *p; /* points to stack or to its own value */ | ||
629 | } v; | ||
622 | union { | 630 | union { |
623 | struct { /* (when open) */ | 631 | struct { /* (when open) */ |
624 | struct UpVal *next; /* linked list */ | 632 | struct UpVal *next; /* linked list */ |