aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-06-26 14:46:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-06-26 14:46:44 -0300
commitfb7e5b76c9d41108c399cf4d16470018b717007b (patch)
treecfc2b875d139727f1847100d8ae0950bee3d4f56 /lopcodes.h
parentc1dc08e8e8e22af9902a6341b4a9a9a7811954cc (diff)
downloadlua-fb7e5b76c9d41108c399cf4d16470018b717007b.tar.gz
lua-fb7e5b76c9d41108c399cf4d16470018b717007b.tar.bz2
lua-fb7e5b76c9d41108c399cf4d16470018b717007b.zip
Clearer code for controlling maximum registers
Plus, added a test to check that limit.
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/lopcodes.h b/lopcodes.h
index 6d888042..235c51f6 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -23,9 +23,9 @@ iAsBx sBx (signed)(17) | A(8) | Op(7) |
23iAx Ax(25) | Op(7) | 23iAx Ax(25) | Op(7) |
24isJ sJ (signed)(25) | Op(7) | 24isJ sJ (signed)(25) | Op(7) |
25 25
26 A signed argument is represented in excess K: the represented value is 26 A signed argument is represented in excess K: The represented value is
27 the written unsigned value minus K, where K is half the maximum for the 27 the written unsigned value minus K, where K is half (rounded down) the
28 corresponding unsigned argument. 28 maximum value for the corresponding unsigned argument.
29===========================================================================*/ 29===========================================================================*/
30 30
31 31
@@ -177,9 +177,16 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */
177 177
178 178
179/* 179/*
180** invalid register that fits in 8 bits 180** Maximum size for the stack of a Lua function. It must fit in 8 bits.
181** The highest valid register is one less than this value.
181*/ 182*/
182#define NO_REG MAXARG_A 183#define MAX_FSTACK MAXARG_A
184
185/*
186** Invalid register (one more than last valid register).
187*/
188#define NO_REG MAX_FSTACK
189
183 190
184 191
185/* 192/*