Add ERR_MEMORY exit code to show that there was not enough memory; fix debug.stm build

This commit is contained in:
Ilmir Usmanov
2014-07-28 19:39:11 +04:00
parent d927d3e320
commit 1b6638f073
4 changed files with 7 additions and 1 deletions
+2
View File
@@ -277,6 +277,8 @@ current_token (void)
JERRY_ASSERT (token_start <= buffer);
size_t length = (size_t) (buffer - token_start);
char *res = (char *) mem_heap_alloc_block (length + 1, MEM_HEAP_ALLOC_SHORT_TERM);
if (res == NULL)
parser_fatal (ERR_MEMORY);
__strncpy (res, token_start, length);
res[length] = '\0';
token_start = NULL;