Fix invocation of memcpy in add_current_token_to_string_cache (NULL pointer shouldn't be passed to memcpy).

This commit is contained in:
Ruben Ayrapetyan 2015-02-13 16:38:59 +03:00
parent 3755db04d2
commit 62a3ac93d9

View File

@ -175,10 +175,10 @@ add_current_token_to_string_cache (void)
+ ((size_t) length + 1) * sizeof (ecma_char_t));
ecma_char_t *temp = (ecma_char_t *) mem_heap_alloc_block (strings_cache_size,
MEM_HEAP_ALLOC_SHORT_TERM);
memcpy (temp, strings_cache, strings_cache_used_size);
STACK_ITERATE_VARG_SET (literals, adjust_string_ptrs, 0, (size_t) (temp - strings_cache));
if (strings_cache)
{
memcpy (temp, strings_cache, strings_cache_used_size);
STACK_ITERATE_VARG_SET (literals, adjust_string_ptrs, 0, (size_t) (temp - strings_cache));
mem_heap_free_block ((uint8_t *) strings_cache);
}
strings_cache = temp;