summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-05-28 16:27:12 +0300
committerDmitry Stogov <dmitry@zend.com>2018-05-28 16:27:12 +0300
commit5eb1f92f31cafc48384f9096012f421b37f6d425 (patch)
tree4ed67b92229407e7b5cbab37b96428fe80eb3f94 /ext/json
parent925f05dd1a35eafa71eb29abb69cdfc31a23a75d (diff)
downloadphp-git-5eb1f92f31cafc48384f9096012f421b37f6d425.tar.gz
Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence.
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/json_parser.tab.c12
-rw-r--r--ext/json/json_parser.tab.h6
-rw-r--r--ext/json/json_parser.y6
3 files changed, 12 insertions, 12 deletions
diff --git a/ext/json/json_parser.tab.c b/ext/json/json_parser.tab.c
index 08e3e2b768..c165a19e53 100644
--- a/ext/json/json_parser.tab.c
+++ b/ext/json/json_parser.tab.c
@@ -139,8 +139,8 @@ int json_yydebug = 1;
/* In a future release of Bison, this section will be replaced
by #include "json_parser.tab.h". */
-#ifndef YY_PHP_JSON_YY_HOME_HUIXINCHEN_OPENSOURCE_TRUNK_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
-# define YY_PHP_JSON_YY_HOME_HUIXINCHEN_OPENSOURCE_TRUNK_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
+#ifndef YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
+# define YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -201,7 +201,7 @@ typedef union YYSTYPE YYSTYPE;
int php_json_yyparse (php_json_parser *parser);
-#endif /* !YY_PHP_JSON_YY_HOME_HUIXINCHEN_OPENSOURCE_TRUNK_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */
+#endif /* !YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */
/* Copy the second part of user declarations. */
@@ -1140,7 +1140,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, php_json_parser *p
case 25: /* pair */
- { zend_string_release(((*yyvaluep).pair).key); zval_dtor(&((*yyvaluep).pair).val); }
+ { zend_string_release_ex(((*yyvaluep).pair).key, 0); zval_dtor(&((*yyvaluep).pair).val); }
break;
@@ -1885,7 +1885,7 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
zval zkey;
if (ZSTR_LEN(key) > 0 && ZSTR_VAL(key)[0] == '\0') {
parser->scanner.errcode = PHP_JSON_ERROR_INVALID_PROPERTY_NAME;
- zend_string_release(key);
+ zend_string_release_ex(key, 0);
zval_dtor(zvalue);
zval_dtor(object);
return FAILURE;
@@ -1894,7 +1894,7 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
zend_std_write_property(object, &zkey, zvalue, NULL);
Z_TRY_DELREF_P(zvalue);
}
- zend_string_release(key);
+ zend_string_release_ex(key, 0);
return SUCCESS;
}
diff --git a/ext/json/json_parser.tab.h b/ext/json/json_parser.tab.h
index 3f126dc9c7..4349b70406 100644
--- a/ext/json/json_parser.tab.h
+++ b/ext/json/json_parser.tab.h
@@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_PHP_JSON_YY_HOME_HUIXINCHEN_OPENSOURCE_TRUNK_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
-# define YY_PHP_JSON_YY_HOME_HUIXINCHEN_OPENSOURCE_TRUNK_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
+#ifndef YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
+# define YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -92,4 +92,4 @@ typedef union YYSTYPE YYSTYPE;
int php_json_yyparse (php_json_parser *parser);
-#endif /* !YY_PHP_JSON_YY_HOME_HUIXINCHEN_OPENSOURCE_TRUNK_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */
+#endif /* !YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */
diff --git a/ext/json/json_parser.y b/ext/json/json_parser.y
index 4c0dfa67d7..489cec1a5e 100644
--- a/ext/json/json_parser.y
+++ b/ext/json/json_parser.y
@@ -75,7 +75,7 @@ int json_yydebug = 1;
%type <pair> pair
%destructor { zval_dtor(&$$); } <value>
-%destructor { zend_string_release($$.key); zval_dtor(&$$.val); } <pair>
+%destructor { zend_string_release_ex($$.key, 0); zval_dtor(&$$.val); } <pair>
%code {
static int php_json_yylex(union YYSTYPE *value, php_json_parser *parser);
@@ -277,7 +277,7 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
zval zkey;
if (ZSTR_LEN(key) > 0 && ZSTR_VAL(key)[0] == '\0') {
parser->scanner.errcode = PHP_JSON_ERROR_INVALID_PROPERTY_NAME;
- zend_string_release(key);
+ zend_string_release_ex(key, 0);
zval_dtor(zvalue);
zval_dtor(object);
return FAILURE;
@@ -286,7 +286,7 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
zend_std_write_property(object, &zkey, zvalue, NULL);
Z_TRY_DELREF_P(zvalue);
}
- zend_string_release(key);
+ zend_string_release_ex(key, 0);
return SUCCESS;
}