Skip to content

Commit

Permalink
lj_api.c: Fix breakage in cherry-pick of ffd2610
Browse files Browse the repository at this point in the history
Had failed to remove some DUALNUM code that does not apply to
RaptorJIT.
  • Loading branch information
lukego committed Aug 13, 2017
1 parent 340f702 commit 4e945d2
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/lj_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@ LUA_API lua_Integer lua_tointeger(lua_State *L, int idx)
} else {
if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp)))
return 0;
if (tvisint(&tmp))
return intV(&tmp);
n = numV(&tmp);
}
return (lua_Integer)n;
Expand All @@ -388,20 +386,13 @@ LUA_API lua_Integer lua_tointegerx(lua_State *L, int idx, int *ok)
cTValue *o = index2adr(L, idx);
TValue tmp;
lua_Number n;
if (LJ_LIKELY(tvisint(o))) {
if (ok) *ok = 1;
return intV(o);
} else if (LJ_LIKELY(tvisnum(o))) {
if (LJ_LIKELY(tvisnum(o))) {
n = numV(o);
} else {
if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) {
if (ok) *ok = 0;
return 0;
}
if (tvisint(&tmp)) {
if (ok) *ok = 1;
return intV(&tmp);
}
n = numV(&tmp);
}
if (ok) *ok = 1;
Expand Down

0 comments on commit 4e945d2

Please sign in to comment.