diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-04 16:38:35 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-04 16:38:35 -0300 |
commit | 435f587ed05e2c4d542e1db9ae9e4efbb7e02305 (patch) | |
tree | 1b179bf836cfdaf8ed74df24c2d22cda8f07aaa9 /lcode.c | |
parent | ae55f3eeada102f3fa8345173410feaf1db42cde (diff) | |
download | lua-435f587ed05e2c4d542e1db9ae9e4efbb7e02305.tar.gz lua-435f587ed05e2c4d542e1db9ae9e4efbb7e02305.tar.bz2 lua-435f587ed05e2c4d542e1db9ae9e4efbb7e02305.zip |
(much) better handling of memory alloction errors
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 1.40 2000/06/28 20:20:36 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.41 2000/06/30 14:35:17 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -620,8 +620,8 @@ int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2) { | |||
620 | } | 620 | } |
621 | if (fs->debug) { | 621 | if (fs->debug) { |
622 | LexState *ls = fs->ls; | 622 | LexState *ls = fs->ls; |
623 | luaX_checklimit(ls, ls->lastline, MAXARG_U, "lines in a chunk"); | 623 | luaM_growvector(fs->L, fs->f->lines, fs->pc, 1, int, |
624 | luaM_growvector(fs->L, fs->f->lines, fs->pc, 1, int, "??", MAXARG_U); | 624 | "code size overflow", MAX_INT); |
625 | fs->f->lines[fs->pc] = ls->lastline; | 625 | fs->f->lines[fs->pc] = ls->lastline; |
626 | } | 626 | } |
627 | /* put new instruction in code array */ | 627 | /* put new instruction in code array */ |