Fix multiple debugger issues. (#1640)

- Wait for free byte code pointers during garbage collection.
- Detect incorrect free requests in the debugger server.
- Ignore byte code blocks loaded from snapshot.
- Use memmove instead of memcpy to avoid receive buffer corruption.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-03-06 11:13:25 +01:00
committed by GitHub
parent b996841a65
commit b5a91069fd
9 changed files with 110 additions and 62 deletions
+10 -2
View File
@@ -708,10 +708,18 @@ ecma_gc_run (jmem_free_unused_memory_severity_t severity) /**< gc severity */
void
ecma_free_unused_memory (jmem_free_unused_memory_severity_t severity) /**< severity of the request */
{
#ifdef JERRY_DEBUGGER
while ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
&& JERRY_CONTEXT (debugger_byte_code_free_tail) != ECMA_NULL_POINTER)
{
/* Wait until all byte code is freed or the connection is aborted. */
jerry_debugger_receive ();
}
#endif /* JERRY_DEBUGGER */
if (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
{
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) > ECMA_PROP_HASHMAP_ALLOC_ON)
{
--JERRY_CONTEXT (ecma_prop_hashmap_alloc_state);