aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-20 17:50:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-20 17:50:56 -0300
commitc15543b9afa31ab5dc564511ae11acd808405e8f (patch)
tree61adad4a35a283342abd8366b9fbed1fadcab423 /lopcodes.h
parentbe05c444818989463dc307eed283503d391f93eb (diff)
downloadlua-c15543b9afa31ab5dc564511ae11acd808405e8f.tar.gz
lua-c15543b9afa31ab5dc564511ae11acd808405e8f.tar.bz2
lua-c15543b9afa31ab5dc564511ae11acd808405e8f.zip
Bug: check for constructor overflow in [exp] fields
The check for constructor overflow was considering only fields with explicit names, ignoring fields with syntax '[exp]=exp'.
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lopcodes.h b/lopcodes.h
index e3ac9d09..97870038 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -254,7 +254,7 @@ OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */
254OP_SETI,/* A B C R[A][B] := RK(C) */ 254OP_SETI,/* A B C R[A][B] := RK(C) */
255OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */ 255OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */
256 256
257OP_NEWTABLE,/* A B C k R[A] := {} */ 257OP_NEWTABLE,/* A vB vC k R[A] := {} */
258 258
259OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][K[C]:shortstring] */ 259OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][K[C]:shortstring] */
260 260
@@ -378,9 +378,9 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */
378 real C = EXTRAARG _ C (the bits of EXTRAARG concatenated with the 378 real C = EXTRAARG _ C (the bits of EXTRAARG concatenated with the
379 bits of C). 379 bits of C).
380 380
381 (*) In OP_NEWTABLE, B is log2 of the hash size (which is always a 381 (*) In OP_NEWTABLE, vB is log2 of the hash size (which is always a
382 power of 2) plus 1, or zero for size zero. If not k, the array size 382 power of 2) plus 1, or zero for size zero. If not k, the array size
383 is C. Otherwise, the array size is EXTRAARG _ C. 383 is vC. Otherwise, the array size is EXTRAARG _ vC.
384 384
385 (*) For comparisons, k specifies what condition the test should accept 385 (*) For comparisons, k specifies what condition the test should accept
386 (true or false). 386 (true or false).