0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 08:11:52 +00:00

Change to GC_IS_RECURSIVE for PHP 7.3

This commit is contained in:
Jan-E 2018-07-05 11:30:20 +02:00
parent c7019e3c1a
commit 826aaa689c
3 changed files with 14 additions and 0 deletions

View File

@ -70,7 +70,11 @@ static v8::Local<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate
v8::Local<v8::Array> newarr;
/* Prevent recursion */
#if PHP_VERSION_ID >= 70300
if (myht && GC_IS_RECURSIVE(myht)) {
#else
if (myht && ZEND_HASH_GET_APPLY_COUNT(myht) > 1) {
#endif
return V8JS_NULL;
}

View File

@ -88,7 +88,11 @@ void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::
zend_class_entry *exception_ce = zend_exception_get_default();
if (instanceof_function(php_exception->ce, exception_ce)) {
#ifdef GC_ADDREF
GC_ADDREF(php_exception);
#else
++GC_REFCOUNT(php_exception);
#endif
zend_exception_set_previous(Z_OBJ_P(return_value), php_exception);
}
}

View File

@ -137,7 +137,9 @@ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, v
zend_try {
/* zend_fcall_info_cache */
#if PHP_VERSION_ID < 70300
fcc.initialized = 1;
#endif
fcc.function_handler = method_ptr;
fcc.calling_scope = object->ce;
fcc.called_scope = object->ce;
@ -1013,7 +1015,11 @@ v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate) /* {{
}
/* Prevent recursion */
#if PHP_VERSION_ID >= 70300
if (myht && GC_IS_RECURSIVE(myht)) {
#else
if (myht && ZEND_HASH_GET_APPLY_COUNT(myht) > 1) {
#endif
return V8JS_NULL;
}