diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-10-10 17:05:40 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-10-10 17:05:40 -0300 |
| commit | 911f1e3e7ff01dafe3e9f77bc9c8e3a25237d7de (patch) | |
| tree | 707dac53378739232f670ff8761fe30985de9858 | |
| parent | a1ef58b3a5986293ed0b7acef50073d94c7f932f (diff) | |
| download | lua-911f1e3e7ff01dafe3e9f77bc9c8e3a25237d7de.tar.gz lua-911f1e3e7ff01dafe3e9f77bc9c8e3a25237d7de.tar.bz2 lua-911f1e3e7ff01dafe3e9f77bc9c8e3a25237d7de.zip | |
raw operation should not convert strings to numbers
| -rw-r--r-- | lobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.116 2017/06/29 15:06:44 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.117 2017/07/07 16:34:32 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 | */ |
| @@ -135,7 +135,7 @@ int luaO_rawarith (lua_State *L, int op, const TValue *p1, const TValue *p2, | |||
| 135 | } | 135 | } |
| 136 | case LUA_OPDIV: case LUA_OPPOW: { /* operate only on floats */ | 136 | case LUA_OPDIV: case LUA_OPPOW: { /* operate only on floats */ |
| 137 | lua_Number n1; lua_Number n2; | 137 | lua_Number n1; lua_Number n2; |
| 138 | if (tonumber(p1, &n1) && tonumber(p2, &n2)) { | 138 | if (tonumberns(p1, n1) && tonumberns(p2, n2)) { |
| 139 | setfltvalue(res, numarith(L, op, n1, n2)); | 139 | setfltvalue(res, numarith(L, op, n1, n2)); |
| 140 | return 1; | 140 | return 1; |
| 141 | } | 141 | } |
