diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-19 14:18:04 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-19 14:18:04 -0200 |
| commit | 3153a41e330a624fccfb7b9ade576767619b4a6b (patch) | |
| tree | 8f7990a25f9a72d232dce77a26b960c9f54f3b5b | |
| parent | d388c165ef79cb9c668e28fa92242ffbc0430e54 (diff) | |
| download | lua-3153a41e330a624fccfb7b9ade576767619b4a6b.tar.gz lua-3153a41e330a624fccfb7b9ade576767619b4a6b.tar.bz2 lua-3153a41e330a624fccfb7b9ade576767619b4a6b.zip | |
no need to save 'pc' in case of allocation errors
(allocation errors do not call message handlers)
| -rw-r--r-- | lvm.c | 4 |
1 files changed, 1 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.326 2017/12/18 17:49:31 roberto Exp $ | 2 | ** $Id: lvm.c,v 2.326 2017/12/18 17:53:50 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -1008,7 +1008,6 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
| 1008 | int b = GETARG_B(i); | 1008 | int b = GETARG_B(i); |
| 1009 | int c = GETARG_C(i); | 1009 | int c = GETARG_C(i); |
| 1010 | Table *t; | 1010 | Table *t; |
| 1011 | savepc(L); /* in case of allocation errors */ | ||
| 1012 | t = luaH_new(L); | 1011 | t = luaH_new(L); |
| 1013 | sethvalue2s(L, ra, t); | 1012 | sethvalue2s(L, ra, t); |
| 1014 | if (b != 0 || c != 0) | 1013 | if (b != 0 || c != 0) |
| @@ -1679,7 +1678,6 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
| 1679 | } | 1678 | } |
| 1680 | h = hvalue(vra); | 1679 | h = hvalue(vra); |
| 1681 | last = ((c-1)*LFIELDS_PER_FLUSH) + n; | 1680 | last = ((c-1)*LFIELDS_PER_FLUSH) + n; |
| 1682 | savepc(L); /* in case of allocation errors */ | ||
| 1683 | if (last > h->sizearray) /* needs more space? */ | 1681 | if (last > h->sizearray) /* needs more space? */ |
| 1684 | luaH_resizearray(L, h, last); /* preallocate it at once */ | 1682 | luaH_resizearray(L, h, last); /* preallocate it at once */ |
| 1685 | for (; n > 0; n--) { | 1683 | for (; n > 0; n--) { |
