aboutsummaryrefslogtreecommitdiff
path: root/lpcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lpcode.c')
-rw-r--r--lpcode.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lpcode.c b/lpcode.c
index f335dcb..d67d42f 100644
--- a/lpcode.c
+++ b/lpcode.c
@@ -519,6 +519,15 @@ static int addinstruction (CompileState *compst, Opcode op, int aux) {
519 return i; 519 return i;
520} 520}
521 521
522/* labeled failure */
523static int addthrowinstruction (CompileState *compst, int aux, int key) {
524 int i = addinstruction(compst, IThrow, aux);
525 getinstr(compst, i).i.key = key;
526 return i;
527}
528
529/* labeled failure */
530
522 531
523/* 532/*
524** Add an instruction followed by space for an offset (to be set later) 533** Add an instruction followed by space for an offset (to be set later)
@@ -996,7 +1005,10 @@ static void codegen (CompileState *compst, TTree *tree, int opt, int tt,
996 tree = sib2(tree); goto tailcall; 1005 tree = sib2(tree); goto tailcall;
997 } 1006 }
998 case TThrow: { /* labeled failure */ 1007 case TThrow: { /* labeled failure */
999 addinstruction(compst, IThrow, (byte) tree->u.label); 1008 /*printf("TThrow %s top %d\n", lua_typename(compst->L, -1), lua_gettop(compst->L));*/
1009 /*lua_rawgeti(compst->L, -1, tree->key);*/
1010 /*printf("Throw2 lab = %s\n", lua_tostring(compst->L, -1));*/
1011 addthrowinstruction(compst, (byte) tree->u.label, tree->key);
1000 break; 1012 break;
1001 } 1013 }
1002 case TRecov: { /* labeled failure */ 1014 case TRecov: { /* labeled failure */