diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-06 15:54:05 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-06 15:54:05 -0300 |
| commit | 4365a45d681b4e71e3c39148489bb8eae538ccf7 (patch) | |
| tree | ea22f0836f252edd7bc7279772158f2b7e549b1e /lparser.h | |
| parent | be8120906304a8658fab998587b969e0e42f5650 (diff) | |
| download | lua-4365a45d681b4e71e3c39148489bb8eae538ccf7.tar.gz lua-4365a45d681b4e71e3c39148489bb8eae538ccf7.tar.bz2 lua-4365a45d681b4e71e3c39148489bb8eae538ccf7.zip | |
Checks for read-only globals
Diffstat (limited to 'lparser.h')
| -rw-r--r-- | lparser.h | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -77,11 +77,12 @@ typedef struct expdesc { | |||
| 77 | int info; /* for generic use */ | 77 | int info; /* for generic use */ |
| 78 | struct { /* for indexed variables */ | 78 | struct { /* for indexed variables */ |
| 79 | short idx; /* index (R or "long" K) */ | 79 | short idx; /* index (R or "long" K) */ |
| 80 | short vidx; /* index in 'actvar.arr' or -1 if not a declared global */ | ||
| 80 | lu_byte t; /* table (register or upvalue) */ | 81 | lu_byte t; /* table (register or upvalue) */ |
| 81 | } ind; | 82 | } ind; |
| 82 | struct { /* for local variables */ | 83 | struct { /* for local variables */ |
| 83 | lu_byte ridx; /* register holding the variable */ | 84 | lu_byte ridx; /* register holding the variable */ |
| 84 | unsigned short vidx; /* compiler index (in 'actvar.arr') */ | 85 | short vidx; /* index in 'actvar.arr' */ |
| 85 | } var; | 86 | } var; |
| 86 | } u; | 87 | } u; |
| 87 | int t; /* patch list of 'exit when true' */ | 88 | int t; /* patch list of 'exit when true' */ |
| @@ -101,7 +102,7 @@ typedef struct expdesc { | |||
| 101 | #define varinreg(v) ((v)->vd.kind <= RDKTOCLOSE) | 102 | #define varinreg(v) ((v)->vd.kind <= RDKTOCLOSE) |
| 102 | 103 | ||
| 103 | 104 | ||
| 104 | /* description of an active local variable */ | 105 | /* description of an active variable */ |
| 105 | typedef union Vardesc { | 106 | typedef union Vardesc { |
| 106 | struct { | 107 | struct { |
| 107 | TValuefields; /* constant value (if it is a compile-time constant) */ | 108 | TValuefields; /* constant value (if it is a compile-time constant) */ |
