n^-m gives float result (instead of error)

This commit is contained in:
Roberto Ierusalimschy
2014-04-27 11:41:11 -03:00
parent cbe4998bc2
commit e98ba351ce
4 changed files with 15 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 2.86 2014/04/01 14:39:55 roberto Exp roberto $
** $Id: lcode.c,v 2.87 2014/04/02 16:44:42 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -768,8 +768,6 @@ static int validop (int op, TValue *v1, TValue *v2) {
return (tointeger(v1, &i) && tointeger(v2, &i));
case LUA_OPMOD: /* integer module by 0 */
return !(ttisinteger(v1) && ttisinteger(v2) && ivalue(v2) == 0);
case LUA_OPPOW: /* negative integer exponentiation */
return !(ttisinteger(v1) && ttisinteger(v2) && ivalue(v2) < 0);
default: return 1; /* everything else is valid */
}
}