Showing the changes to src/lcode.c (1 of 60 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** $Id: lcode.c,v 2.25a 2006/03/21 19:28:49 roberto Exp $ | |
| 2 | +** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ | |
| 3 | 3 | ** Code generator for Lua |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -699,7 +699,7 @@ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { · 693 unmodified lines | ||
| 699 | 699 | e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; |
| 700 | 700 | switch (op) { |
| 701 | 701 | case OPR_MINUS: { |
| 702 | − if (e->k == VK) | |
| 702 | + if (!isnumeral(e)) | |
| 703 | 703 | luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ |
| 704 | 704 | codearith(fs, OP_UNM, e, &e2); |
| 705 | 705 | break; |