Fix deleting native pointers (#4570)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-02-05 19:35:30 +01:00
committed by GitHub
parent ca6c2194bb
commit b1f73e698a
4 changed files with 179 additions and 49 deletions
+9 -1
View File
@@ -1084,12 +1084,19 @@ ecma_gc_free_native_pointer (ecma_property_t *property_p) /**< property */
JERRY_ASSERT (property_p != NULL);
ecma_property_value_t *value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
if (value_p->value == JMEM_CP_NULL)
{
return;
}
ecma_native_pointer_t *native_pointer_p;
native_pointer_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_native_pointer_t,
value_p->value);
JERRY_ASSERT (native_pointer_p != NULL);
while (native_pointer_p != NULL)
do
{
if (native_pointer_p->info_p != NULL)
{
@@ -1107,6 +1114,7 @@ ecma_gc_free_native_pointer (ecma_property_t *property_p) /**< property */
native_pointer_p = next_p;
}
while (native_pointer_p != NULL);
} /* ecma_gc_free_native_pointer */
/**