aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-04-07 15:14:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-04-07 15:14:12 -0300
commit427ee519db76b7a0747b5fc1d5dcf97092b5c0bf (patch)
tree9c4000cbd08211ddc5de55db60dde2c8ba1dd16e /lcode.c
parenta958b711f511e4f533d27cc6c27196e87b8cf346 (diff)
downloadlua-427ee519db76b7a0747b5fc1d5dcf97092b5c0bf.tar.gz
lua-427ee519db76b7a0747b5fc1d5dcf97092b5c0bf.tar.bz2
lua-427ee519db76b7a0747b5fc1d5dcf97092b5c0bf.zip
new instruction OP_LOADKX (to replace OP_LOADK with extra argument)
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lcode.c b/lcode.c
index b0edeafe..ab2a8295 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.50 2011/01/31 14:28:41 roberto Exp roberto $ 2** $Id: lcode.c,v 2.51 2011/02/01 18:03:10 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -242,11 +242,11 @@ static int codeextraarg (FuncState *fs, int a) {
242} 242}
243 243
244 244
245int luaK_codeABxX (FuncState *fs, OpCode o, int reg, int k) { 245int luaK_codek (FuncState *fs, int reg, int k) {
246 if (k < MAXARG_Bx) 246 if (k <= MAXARG_Bx)
247 return luaK_codeABx(fs, o, reg, k + 1); 247 return luaK_codeABx(fs, OP_LOADK, reg, k);
248 else { 248 else {
249 int p = luaK_codeABx(fs, o, reg, 0); 249 int p = luaK_codeABx(fs, OP_LOADKX, reg, 0);
250 codeextraarg(fs, k); 250 codeextraarg(fs, k);
251 return p; 251 return p;
252 } 252 }