diff --git a/tests/issue_316_basic.phpt b/tests/issue_316_basic.phpt new file mode 100644 index 0000000..cc1ce9d --- /dev/null +++ b/tests/issue_316_basic.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test V8::executeString() : Issue #316 endless property iteration +--SKIPIF-- + +--FILE-- +executeString('({test: "test"})'); +foreach ($values as $value) { + var_dump($value); +} + +?> +===EOF=== +--EXPECT-- +string(4) "test" +===EOF=== diff --git a/v8js_v8object_class.cc b/v8js_v8object_class.cc index dcfc384..49669ac 100644 --- a/v8js_v8object_class.cc +++ b/v8js_v8object_class.cc @@ -224,7 +224,7 @@ static HashTable *v8js_v8object_get_properties(zval *object) /* {{{ */ * it (instead of crashing the engine). */ return obj->properties; } - } else { + } else if (!obj->properties->u.v.nIteratorsCount) { zend_hash_clean(obj->properties); }