(much) better handling of memory alloction errors

This commit is contained in:
Roberto Ierusalimschy
2000-08-04 16:38:35 -03:00
parent ae55f3eead
commit 435f587ed0
10 changed files with 137 additions and 88 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 1.40 2000/06/28 20:20:36 roberto Exp roberto $
** $Id: lcode.c,v 1.41 2000/06/30 14:35:17 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -620,8 +620,8 @@ int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2) {
}
if (fs->debug) {
LexState *ls = fs->ls;
luaX_checklimit(ls, ls->lastline, MAXARG_U, "lines in a chunk");
luaM_growvector(fs->L, fs->f->lines, fs->pc, 1, int, "??", MAXARG_U);
luaM_growvector(fs->L, fs->f->lines, fs->pc, 1, int,
"code size overflow", MAX_INT);
fs->f->lines[fs->pc] = ls->lastline;
}
/* put new instruction in code array */