php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch Fix_type_cast_and_replace_IS_CONSTANT_INDEX_with_IS_CONSTANT_AST for hidef Bug #69235

Patch version 2015-03-15 15:20 UTC

Return to Bug #69235 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: me@umakantpatil.com

commit f426a7f2c88b423d76f61c1f739a833390e68af4
Author: Uma <umakantp@glam.com>
Date:   Sun Mar 15 20:45:22 2015 +0530

    Fix cast typing and Replace instances of IS_CONSTANT_ARRAY with IS_CONSTANT_AST
    
    IS_CONSTANT_ARRAY and IS_CONSTANT_AST hold the same value
    
    Ref: https://github.com/php/php-src/commit/82ecdcdb6352f851e351f70f19b85aff06de0e4b#diff-2e4b71f255095863524bb18e8e26b815

diff --git a/src/main/c/frozenarray.c b/src/main/c/frozenarray.c
index 166d4b1..4a5c119 100644
--- a/src/main/c/frozenarray.c
+++ b/src/main/c/frozenarray.c
@@ -720,7 +720,7 @@ HashTable* frozen_array_get_properties(zval *object TSRMLS_DC)
 
 	if(thawed) 
 	{
-		if(Z_TYPE_P(thawed) == IS_CONSTANT_ARRAY || 
+		if(Z_TYPE_P(thawed) == IS_CONSTANT_AST || 
 			Z_TYPE_P(thawed) == IS_ARRAY)
 		{
 			return Z_ARRVAL_P(thawed);
@@ -925,7 +925,7 @@ zval* frozen_array_copy_zval_ptr(zval* dst, zval* src, int persistent, size_t* a
         break;
 
 		case IS_ARRAY:
-		case IS_CONSTANT_ARRAY:
+		case IS_CONSTANT_AST:
 		{
 			if(!Z_ISREF_P(src))
 			{
@@ -1021,7 +1021,7 @@ void frozen_array_free_zval_ptr(zval** val, int persistent TSRMLS_DC)
         break;
 
 		case IS_ARRAY:
-		case IS_CONSTANT_ARRAY:
+		case IS_CONSTANT_AST:
 			frozen_array_free_hashtable(&Z_ARRVAL_P(value), persistent TSRMLS_CC);
 			break;
 
@@ -1043,7 +1043,7 @@ zval* frozen_array_unserialize(const char* filename TSRMLS_DC)
 	zval* retval;
 	long len = 0;
 	struct stat sb;
-	char *contents, *tmp;
+	char *contents, *tmp, *conl;
 	FILE *fp;
 	php_unserialize_data_t var_hash;
 	HashTable class_table = {0,};
@@ -1080,9 +1080,10 @@ zval* frozen_array_unserialize(const char* filename TSRMLS_DC)
 	orig_class_table = EG(class_table);
 	EG(class_table) = &class_table;
 	zend_objects_store_init(&EG(objects_store), 1024);
+	conl = contents+len;
 	
 	/* I wish I could use json */
-	if(!php_var_unserialize(&data, (const unsigned char**)&tmp, contents+len, &var_hash TSRMLS_CC))
+	if(!php_var_unserialize(&data, (const unsigned char**)&tmp, (const unsigned char*)&conl, &var_hash TSRMLS_CC))
 	{
 		zval_ptr_dtor(&data);
 		free(contents);
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 01:01:35 2019 UTC