Skip to content

Instantly share code, notes, and snippets.

Created September 30, 2014 15:25
Show Gist options
  • Save anonymous/98124dd5716de89e2c19 to your computer and use it in GitHub Desktop.
Save anonymous/98124dd5716de89e2c19 to your computer and use it in GitHub Desktop.
From 568928c3d03a1727d17d4e09d684874c41cfd61e Mon Sep 17 00:00:00 2001
From: Adrian Guenter <adrianguenter@gmail.com>
Date: Mon, 18 Aug 2014 22:44:38 -0400
Subject: [PATCH] IS_CONSTANT_ARRAY replaced by IS_CONSTANT_AST and fixed
integer casts
---
runkit_import.c | 12 ++++++------
runkit_props.c | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/runkit_import.c b/runkit_import.c
index d66e57f..ca7eb16 100644
--- a/runkit_import.c
+++ b/runkit_import.c
@@ -231,12 +231,12 @@ static int php_runkit_import_class_consts(zend_class_entry *dce, zend_class_entr
}
}
if (
- Z_TYPE_PP(c) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(c) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(c) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif
) {
- zval_update_constant_ex(c, (void*) 1, dce TSRMLS_CC);
+ zval_update_constant_ex(c, 1, dce TSRMLS_CC);
}
Z_ADDREF_P(*c);
if (zend_hash_add_or_update(&dce->constants_table, key, key_len, (void*)c, sizeof(zval*), NULL, action) == FAILURE) {
@@ -280,7 +280,7 @@ static int php_runkit_import_class_static_props(zend_class_entry *dce, zend_clas
#else
zend_hash_quick_find(CE_STATIC_MEMBERS(ce), property_info_ptr->name, property_info_ptr->name_length + 1, property_info_ptr->h, (void*) &pp);
if (
- Z_TYPE_PP(pp) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(pp) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif // RUNKIT_ABOVE53
@@ -294,7 +294,7 @@ static int php_runkit_import_class_static_props(zend_class_entry *dce, zend_clas
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to import %s::$%s (cannot remove old member)", dce->name, key);
goto import_st_prop_skip;
}
- zval_update_constant(pp, dce TSRMLS_CC);
+ zval_update_constant(pp, (long) dce TSRMLS_CC);
if (php_runkit_def_prop_add_int(dce, key, key_len - 1, *pp, property_info_ptr->flags,
property_info_ptr->doc_comment,
property_info_ptr->doc_comment_len, dce,
@@ -364,12 +364,12 @@ static int php_runkit_import_class_props(zend_class_entry *dce, zend_class_entry
}
#endif // (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
if (
- Z_TYPE_PP(p) == IS_CONSTANT_ARRAY
+ Z_TYPE_PP(p) == IS_CONSTANT_AST
#if RUNKIT_ABOVE53
|| (Z_TYPE_PP(p) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
#endif // RUNKIT_ABOVE53
) {
- zval_update_constant_ex(p, (void*) 1, dce TSRMLS_CC);
+ zval_update_constant_ex(p, 1, dce TSRMLS_CC);
}
php_runkit_def_prop_add_int(dce, key, key_len - 1, *p,
diff --git a/runkit_props.c b/runkit_props.c
index 4f2bc9b..2e9c7df 100644
--- a/runkit_props.c
+++ b/runkit_props.c
@@ -544,12 +544,12 @@ static int php_runkit_def_prop_add(char *classname, int classname_len, char *pro
return FAILURE;
}
if (
- Z_TYPE_P(copyval) == IS_CONSTANT_ARRAY
+ Z_TYPE_P(copyval) == IS_CONSTANT_AST
# if RUNKIT_ABOVE53
|| (Z_TYPE_P(copyval) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT
# endif
) {
- zval_update_constant_ex(&copyval, (void*) 1, ce TSRMLS_CC);
+ zval_update_constant_ex(&copyval, 1, ce TSRMLS_CC);
}
#else
if (zend_hash_exists(&ce->default_properties, key, key_len + 1)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment