aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-03-13 13:24:50 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-03-13 13:24:50 -0300
commit331632e8d8861a62b69ae7c3c9a148411c5a44ab (patch)
treee9ceacab0cd43a6016ad50fa8cb1e59ed0bcc9af
parent7d930ec694dc079a252323d2136fbf4d49a49888 (diff)
downloadlua-331632e8d8861a62b69ae7c3c9a148411c5a44ab.tar.gz
lua-331632e8d8861a62b69ae7c3c9a148411c5a44ab.tar.bz2
lua-331632e8d8861a62b69ae7c3c9a148411c5a44ab.zip
code detail ('if' -> '?:')
-rw-r--r--ltests.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ltests.c b/ltests.c
index 858df9dd..80bfa5a6 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.202 2015/01/16 16:54:37 roberto Exp roberto $ 2** $Id: ltests.c,v 2.203 2015/03/11 16:10:41 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -289,11 +289,11 @@ static void checkLclosure (global_State *g, LClosure *cl) {
289static int lua_checkpc (lua_State *L, CallInfo *ci) { 289static int lua_checkpc (lua_State *L, CallInfo *ci) {
290 if (!isLua(ci)) return 1; 290 if (!isLua(ci)) return 1;
291 else { 291 else {
292 Proto *p; 292 /* if function yielded (inside a hook), real 'func' is in 'extra' field */
293 if (L->status != LUA_YIELD || ci != L->ci) 293 StkId f = (L->status != LUA_YIELD || ci != L->ci)
294 p = clLvalue(ci->func)->p; 294 ? ci->func
295 else /* real 'func' was saved in 'extra' field */ 295 : restorestack(L, ci->extra);
296 p = clLvalue(restorestack(L, ci->extra))->p; 296 Proto *p = clLvalue(f)->p;
297 return p->code <= ci->u.l.savedpc && 297 return p->code <= ci->u.l.savedpc &&
298 ci->u.l.savedpc <= p->code + p->sizecode; 298 ci->u.l.savedpc <= p->code + p->sizecode;
299 } 299 }