summaryrefslogtreecommitdiff
path: root/src/lj_api.c
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-08 19:52:28 +0100
committerMike Pall <mike>2009-12-08 19:52:28 +0100
commit5287b9326479ea2b7dddd6f642673e58e5a7f354 (patch)
treef6f9fe375652f6cfc607d8c5f022ccbaff857c4d /src/lj_api.c
parent2d0ef4522bebcc380e9aaf21b9bebcb62fcfc4fe (diff)
downloadluajit2-5287b9326479ea2b7dddd6f642673e58e5a7f354.tar.gz
LuaJIT-2.0.0-beta2 hotfix #2v2.0.0-beta2-hotfix2
Fix lua_tocfunction(). Fix cutoff register in JMP bytecode for some conditional expressions. Fix PHI marking algorithm for references from variant slots.
Diffstat (limited to 'src/lj_api.c')
-rw-r--r--src/lj_api.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lj_api.c b/src/lj_api.c
index db48e3a6..7a759e5f 100644
--- a/src/lj_api.c
+++ b/src/lj_api.c
@@ -486,8 +486,12 @@ LUA_API size_t lua_objlen(lua_State *L, int idx)
LUA_API lua_CFunction lua_tocfunction(lua_State *L, int idx)
{
cTValue *o = index2adr(L, idx);
- ASMFunction gate = funcV(o)->c.gate;
- return (gate == lj_gate_c || gate == lj_gate_cwrap) ? funcV(o)->c.f : NULL;
+ if (tvisfunc(o)) {
+ ASMFunction gate = funcV(o)->c.gate;
+ if (gate == lj_gate_c || gate == lj_gate_cwrap)
+ return funcV(o)->c.f;
+ }
+ return NULL;
}
LUA_API void *lua_touserdata(lua_State *L, int idx)