mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 18:41:52 +00:00
Always increase the zval reference count before storing it in a V8 internal field.
This commit is contained in:
parent
06527cf1d9
commit
a23ecda69f
@ -386,10 +386,7 @@ static v8::Handle<v8::Value> php_v8js_hash_to_jsobj(zval *value TSRMLS_DC) /* {{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// See https://github.com/preillyme/v8js/issues/6
|
// See https://github.com/preillyme/v8js/issues/6
|
||||||
if (Z_REFCOUNT_P(value) == 1)
|
Z_SET_REFCOUNT_P(value, Z_REFCOUNT_P(value) + 1);
|
||||||
{
|
|
||||||
Z_SET_REFCOUNT_P(value, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
newobj->SetAlignedPointerInInternalField(0, (void *) value);
|
newobj->SetAlignedPointerInInternalField(0, (void *) value);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user