diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-01-04 16:49:54 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-01-04 16:49:54 -0200 |
commit | ad97e9ccbcfff5cd6e8d9399a49fb4de8b87561e (patch) | |
tree | 9f4ebf4a0a87225064b64afaed75ac9d4dc0e624 | |
parent | e4c69cf91710337b9c80039853941d48d211fcfd (diff) | |
download | lua-ad97e9ccbcfff5cd6e8d9399a49fb4de8b87561e.tar.gz lua-ad97e9ccbcfff5cd6e8d9399a49fb4de8b87561e.tar.bz2 lua-ad97e9ccbcfff5cd6e8d9399a49fb4de8b87561e.zip |
small bug in fallback for power operator
-rw-r--r-- | mathlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Mathematics library to LUA | 3 | ** Mathematics library to LUA |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_mathlib="$Id: mathlib.c,v 1.6 1994/11/18 19:46:21 roberto Stab roberto $"; | 6 | char *rcs_mathlib="$Id: mathlib.c,v 1.7 1994/12/16 15:53:57 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <stdio.h> /* NULL */ | 8 | #include <stdio.h> /* NULL */ |
9 | #include <math.h> | 9 | #include <math.h> |
@@ -169,10 +169,11 @@ static void math_pow (void) | |||
169 | lua_Object op = lua_getparam(3); | 169 | lua_Object op = lua_getparam(3); |
170 | if (!lua_isnumber(o1) || !lua_isnumber(o2) || *(lua_getstring(op)) != 'p') | 170 | if (!lua_isnumber(o1) || !lua_isnumber(o2) || *(lua_getstring(op)) != 'p') |
171 | { | 171 | { |
172 | lua_Object old = lua_getlocked(old_pow); | ||
172 | lua_pushobject(o1); | 173 | lua_pushobject(o1); |
173 | lua_pushobject(o2); | 174 | lua_pushobject(o2); |
174 | lua_pushobject(op); | 175 | lua_pushobject(op); |
175 | if (lua_callfunction(lua_getlocked(old_pow)) != 0) | 176 | if (lua_callfunction(old) != 0) |
176 | lua_error(NULL); | 177 | lua_error(NULL); |
177 | } | 178 | } |
178 | else | 179 | else |