mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix invocation of memcpy in add_current_token_to_string_cache (NULL pointer shouldn't be passed to memcpy).
This commit is contained in:
parent
3755db04d2
commit
62a3ac93d9
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user