@@ -4212,20 +4212,13 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_array(zend_ar
4212
4212
4213
4213
#define ZEND_FAKE_OP_ARRAY ((zend_op_array*)(zend_intptr_t)-1)
4214
4214
4215
- static zend_never_inline zend_op_array * ZEND_FASTCALL zend_include_or_eval (zval * inc_filename , int type ) /* {{{ */
4215
+ static zend_never_inline zend_op_array * ZEND_FASTCALL zend_include_or_eval (zval * inc_filename_zv , int type ) /* {{{ */
4216
4216
{
4217
4217
zend_op_array * new_op_array = NULL ;
4218
- zval tmp_inc_filename ;
4219
-
4220
- ZVAL_UNDEF (& tmp_inc_filename );
4221
- if (Z_TYPE_P (inc_filename ) != IS_STRING ) {
4222
- zend_string * tmp = zval_try_get_string_func (inc_filename );
4223
-
4224
- if (UNEXPECTED (!tmp )) {
4225
- return NULL ;
4226
- }
4227
- ZVAL_STR (& tmp_inc_filename , tmp );
4228
- inc_filename = & tmp_inc_filename ;
4218
+ zend_string * tmp_inc_filename ;
4219
+ zend_string * inc_filename = zval_try_get_tmp_string (inc_filename_zv , & tmp_inc_filename );
4220
+ if (UNEXPECTED (!inc_filename )) {
4221
+ return NULL ;
4229
4222
}
4230
4223
4231
4224
switch (type ) {
@@ -4234,7 +4227,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
4234
4227
zend_file_handle file_handle ;
4235
4228
zend_string * resolved_path ;
4236
4229
4237
- resolved_path = zend_resolve_path (Z_STR_P ( inc_filename ) );
4230
+ resolved_path = zend_resolve_path (inc_filename );
4238
4231
if (EXPECTED (resolved_path )) {
4239
4232
if (zend_hash_exists (& EG (included_files ), resolved_path )) {
4240
4233
new_op_array = ZEND_FAKE_OP_ARRAY ;
@@ -4243,14 +4236,14 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
4243
4236
}
4244
4237
} else if (UNEXPECTED (EG (exception ))) {
4245
4238
break ;
4246
- } else if (UNEXPECTED (strlen (Z_STRVAL_P (inc_filename )) != Z_STRLEN_P (inc_filename ))) {
4239
+ } else if (UNEXPECTED (strlen (ZSTR_VAL (inc_filename )) != ZSTR_LEN (inc_filename ))) {
4247
4240
zend_message_dispatcher (
4248
4241
(type == ZEND_INCLUDE_ONCE ) ?
4249
4242
ZMSG_FAILED_INCLUDE_FOPEN : ZMSG_FAILED_REQUIRE_FOPEN ,
4250
- Z_STRVAL_P (inc_filename ));
4243
+ ZSTR_VAL (inc_filename ));
4251
4244
break ;
4252
4245
} else {
4253
- resolved_path = zend_string_copy (Z_STR_P ( inc_filename ) );
4246
+ resolved_path = zend_string_copy (inc_filename );
4254
4247
}
4255
4248
4256
4249
zend_stream_init_filename_ex (& file_handle , resolved_path );
@@ -4264,9 +4257,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
4264
4257
zend_op_array * op_array = zend_compile_file (& file_handle , (type == ZEND_INCLUDE_ONCE ?ZEND_INCLUDE :ZEND_REQUIRE ));
4265
4258
zend_destroy_file_handle (& file_handle );
4266
4259
zend_string_release_ex (resolved_path , 0 );
4267
- if (Z_TYPE (tmp_inc_filename ) != IS_UNDEF ) {
4268
- zval_ptr_dtor_str (& tmp_inc_filename );
4269
- }
4260
+ zend_tmp_string_release (tmp_inc_filename );
4270
4261
return op_array ;
4271
4262
} else {
4272
4263
new_op_array = ZEND_FAKE_OP_ARRAY ;
@@ -4275,37 +4266,33 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
4275
4266
zend_message_dispatcher (
4276
4267
(type == ZEND_INCLUDE_ONCE ) ?
4277
4268
ZMSG_FAILED_INCLUDE_FOPEN : ZMSG_FAILED_REQUIRE_FOPEN ,
4278
- Z_STRVAL_P (inc_filename ));
4269
+ ZSTR_VAL (inc_filename ));
4279
4270
}
4280
4271
zend_destroy_file_handle (& file_handle );
4281
4272
zend_string_release_ex (resolved_path , 0 );
4282
4273
}
4283
4274
break ;
4284
4275
case ZEND_INCLUDE :
4285
4276
case ZEND_REQUIRE :
4286
- if (UNEXPECTED (strlen (Z_STRVAL_P (inc_filename )) != Z_STRLEN_P (inc_filename ))) {
4277
+ if (UNEXPECTED (strlen (ZSTR_VAL (inc_filename )) != ZSTR_LEN (inc_filename ))) {
4287
4278
zend_message_dispatcher (
4288
4279
(type == ZEND_INCLUDE ) ?
4289
4280
ZMSG_FAILED_INCLUDE_FOPEN : ZMSG_FAILED_REQUIRE_FOPEN ,
4290
- Z_STRVAL_P (inc_filename ));
4281
+ ZSTR_VAL (inc_filename ));
4291
4282
break ;
4292
4283
}
4293
4284
new_op_array = compile_filename (type , inc_filename );
4294
4285
break ;
4295
4286
case ZEND_EVAL : {
4296
4287
char * eval_desc = zend_make_compiled_string_description ("eval()'d code" );
4297
- zend_string * code = zval_get_string (inc_filename );
4298
- new_op_array = zend_compile_string (code , eval_desc );
4299
- zend_string_release (code );
4288
+ new_op_array = zend_compile_string (inc_filename , eval_desc );
4300
4289
efree (eval_desc );
4301
4290
}
4302
4291
break ;
4303
4292
EMPTY_SWITCH_DEFAULT_CASE ()
4304
4293
}
4305
4294
4306
- if (Z_TYPE (tmp_inc_filename ) != IS_UNDEF ) {
4307
- zval_ptr_dtor_str (& tmp_inc_filename );
4308
- }
4295
+ zend_tmp_string_release (tmp_inc_filename );
4309
4296
return new_op_array ;
4310
4297
}
4311
4298
/* }}} */
0 commit comments