diff options
Diffstat (limited to 'lpvm.c')
-rw-r--r-- | lpvm.c | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -331,15 +331,32 @@ const char *match (lua_State *L, const char *o, const char *s, const char *e, | |||
331 | continue; | 331 | continue; |
332 | } | 332 | } |
333 | case IThrow: { /* labeled failure */ | 333 | case IThrow: { /* labeled failure */ |
334 | printf("IThrow here: key=%d aux = %d top = %d\n", p->i.key, p->i.aux, lua_gettop(L)); | 334 | /*printf("IThrow here: key=%d, key+1=%d aux = %d top = %d\n", p->i.key, (p+1)->i.key, p->i.aux, lua_gettop(L)); |
335 | lua_rawgeti(L, ktableidx(ptop), p->i.key); | 335 | lua_rawgeti(L, ktableidx(ptop), (p+1)->i.key); |
336 | printf("IThrow there %s top = %d\n", lua_tostring(L, -1), lua_gettop(L)); | 336 | printf("IThrow there %s top = %d\n", lua_tostring(L, -1), lua_gettop(L)); |
337 | lua_pop(L, 1); | 337 | lua_pop(L, 1);*/ |
338 | *labelf = p->i.key; | 338 | *labelf = (p+1)->i.key; |
339 | pk = p + 1; | 339 | pk = p + 1; |
340 | *sfail = s; | 340 | *sfail = s; |
341 | goto fail; | 341 | goto fail; |
342 | } | 342 | } |
343 | case IThrowRec: { /* labeled failure */ | ||
344 | /*printf("IThrowRec here: key=%d, key+2=%d aux = %d top = %d\n", p->i.key, (p+2)->i.key, p->i.aux, lua_gettop(L)); | ||
345 | lua_rawgeti(L, ktableidx(ptop), (p+2)->i.key); | ||
346 | printf("IThrowRec there %s top = %d\n", lua_tostring(L, -1), lua_gettop(L)); | ||
347 | lua_pop(L, 1);*/ | ||
348 | *labelf = (p+2)->i.key; | ||
349 | *sfail = s; | ||
350 | if (stack == stacklimit) | ||
351 | stack = doublestack(L, &stacklimit, ptop); | ||
352 | stack->s = NULL; | ||
353 | stack->p = p + 3; | ||
354 | stack->ls = NULL; | ||
355 | stack->caplevel = captop; | ||
356 | stack++; | ||
357 | p += getoffset(p); | ||
358 | continue; | ||
359 | } | ||
343 | case IFailTwice: | 360 | case IFailTwice: |
344 | assert(stack > getstackbase(L, ptop)); | 361 | assert(stack > getstackbase(L, ptop)); |
345 | stack--; | 362 | stack--; |