aboutsummaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-08 12:50:23 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-08 12:50:23 -0200
commit26679ea35bf261f2b5edc2fb2f5cc4df483fd50d (patch)
tree94c99ed74251cdf3e10a7e52560c3a7a78053ad1 /lobject.c
parentc3e5946fb2b7b5781d9bca9d303967abe6263482 (diff)
downloadlua-26679ea35bf261f2b5edc2fb2f5cc4df483fd50d.tar.gz
lua-26679ea35bf261f2b5edc2fb2f5cc4df483fd50d.tar.bz2
lua-26679ea35bf261f2b5edc2fb2f5cc4df483fd50d.zip
new function 'luaV_flttointeger' to convert floats to integers (without
string coercions) + string operands to bitwise operations handled by string metamethods
Diffstat (limited to 'lobject.c')
-rw-r--r--lobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lobject.c b/lobject.c
index 470d75db..32cdc4b0 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.117 2017/07/07 16:34:32 roberto Exp roberto $ 2** $Id: lobject.c,v 2.118 2017/10/10 20:05:40 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -127,7 +127,7 @@ int luaO_rawarith (lua_State *L, int op, const TValue *p1, const TValue *p2,
127 case LUA_OPSHL: case LUA_OPSHR: 127 case LUA_OPSHL: case LUA_OPSHR:
128 case LUA_OPBNOT: { /* operate only on integers */ 128 case LUA_OPBNOT: { /* operate only on integers */
129 lua_Integer i1; lua_Integer i2; 129 lua_Integer i1; lua_Integer i2;
130 if (tointeger(p1, &i1) && tointeger(p2, &i2)) { 130 if (tointegerns(p1, &i1) && tointegerns(p2, &i2)) {
131 setivalue(res, intarith(L, op, i1, i2)); 131 setivalue(res, intarith(L, op, i1, i2));
132 return 1; 132 return 1;
133 } 133 }