aboutsummaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-07-07 13:34:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-07-07 13:34:32 -0300
commit4dff277255e3785b76b6b52fe2a98592e6cbc834 (patch)
treee3607d2aab29b6e0dbd46ac1acc81e9c6bf08dd7 /lobject.c
parent07db10813cb044252c18973688f63b5eac6a90a6 (diff)
downloadlua-4dff277255e3785b76b6b52fe2a98592e6cbc834.tar.gz
lua-4dff277255e3785b76b6b52fe2a98592e6cbc834.tar.bz2
lua-4dff277255e3785b76b6b52fe2a98592e6cbc834.zip
coercion string->number in arithmetic operations moved to string
library
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 9ad833c9..21616fad 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.115 2017/05/24 13:47:11 roberto Exp roberto $ 2** $Id: lobject.c,v 2.116 2017/06/29 15:06:44 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*/
@@ -147,7 +147,7 @@ int luaO_rawarith (lua_State *L, int op, const TValue *p1, const TValue *p2,
147 setivalue(res, intarith(L, op, ivalue(p1), ivalue(p2))); 147 setivalue(res, intarith(L, op, ivalue(p1), ivalue(p2)));
148 return 1; 148 return 1;
149 } 149 }
150 else if (tonumber(p1, &n1) && tonumber(p2, &n2)) { 150 else if (tonumberns(p1, n1) && tonumberns(p2, n2)) {
151 setfltvalue(res, numarith(L, op, n1, n2)); 151 setfltvalue(res, numarith(L, op, n1, n2));
152 return 1; 152 return 1;
153 } 153 }