@@ -131,7 +131,7 @@ static zend_string *zend_build_runtime_definition_key(zend_string *name, unsigne
131131{
132132 zend_string * result ;
133133 char char_pos_buf [32 ];
134- size_t char_pos_len = zend_sprintf (char_pos_buf , "%p" , lex_pos );
134+ size_t char_pos_len = sprintf (char_pos_buf , "%p" , lex_pos );
135135 zend_string * filename = CG (active_op_array )-> filename ;
136136
137137 /* NULL, name length, filename length, last accepting char position length */
@@ -3941,7 +3941,7 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{
39413941}
39423942/* }}} */
39433943
3944- void zend_compile_class_decl (zend_ast * ast , zend_bool toplevel );
3944+ zend_op * zend_compile_class_decl (zend_ast * ast , zend_bool toplevel );
39453945
39463946void zend_compile_new (znode * result , zend_ast * ast ) /* {{{ */
39473947{
@@ -3952,13 +3952,8 @@ void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */
39523952 zend_op * opline ;
39533953
39543954 if (class_ast -> kind == ZEND_AST_CLASS ) {
3955- uint32_t dcl_opnum = get_next_op_number ();
3956- zend_compile_class_decl (class_ast , 0 );
39573955 /* jump over anon class declaration */
3958- opline = & CG (active_op_array )-> opcodes [dcl_opnum ];
3959- if (opline -> opcode == ZEND_FETCH_CLASS ) {
3960- opline ++ ;
3961- }
3956+ opline = zend_compile_class_decl (class_ast , 0 );
39623957 class_node .op_type = opline -> result_type ;
39633958 class_node .u .op .var = opline -> result .var ;
39643959 opline -> extended_value = get_next_op_number ();
@@ -4277,7 +4272,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
42774272 zend_ast * depth_ast = ast -> child [0 ];
42784273
42794274 zend_op * opline ;
4280- int depth ;
4275+ zend_long depth ;
42814276
42824277 ZEND_ASSERT (ast -> kind == ZEND_AST_BREAK || ast -> kind == ZEND_AST_CONTINUE );
42834278
@@ -4304,7 +4299,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
43044299 ast -> kind == ZEND_AST_BREAK ? "break" : "continue" );
43054300 } else {
43064301 if (!zend_handle_loops_and_finally_ex (depth , NULL )) {
4307- zend_error_noreturn (E_COMPILE_ERROR , "Cannot '%s' %d level%s" ,
4302+ zend_error_noreturn (E_COMPILE_ERROR , "Cannot '%s' " ZEND_LONG_FMT " level%s" ,
43084303 ast -> kind == ZEND_AST_BREAK ? "break" : "continue" ,
43094304 depth , depth == 1 ? "" : "s" );
43104305 }
@@ -4321,12 +4316,12 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
43214316 if (depth == 1 ) {
43224317 zend_error (E_WARNING ,
43234318 "\"continue\" targeting switch is equivalent to \"break\". " \
4324- "Did you mean to use \"continue %d \"?" ,
4319+ "Did you mean to use \"continue " ZEND_LONG_FMT " \"?" ,
43254320 depth + 1 );
43264321 } else {
43274322 zend_error (E_WARNING ,
4328- "\"continue %d \" targeting switch is equivalent to \"break %d \". " \
4329- "Did you mean to use \"continue %d \"?" ,
4323+ "\"continue " ZEND_LONG_FMT " \" targeting switch is equivalent to \"break " ZEND_LONG_FMT " \". " \
4324+ "Did you mean to use \"continue " ZEND_LONG_FMT " \"?" ,
43304325 depth , depth , depth + 1 );
43314326 }
43324327 }
@@ -6126,7 +6121,7 @@ static zend_string *zend_generate_anon_class_name(unsigned char *lex_pos) /* {{{
61266121{
61276122 zend_string * result ;
61286123 char char_pos_buf [32 ];
6129- size_t char_pos_len = zend_sprintf (char_pos_buf , "%p" , lex_pos );
6124+ size_t char_pos_len = sprintf (char_pos_buf , "%p" , lex_pos );
61306125 zend_string * filename = CG (active_op_array )-> filename ;
61316126
61326127 /* NULL, name length, filename length, last accepting char position length */
@@ -6136,7 +6131,7 @@ static zend_string *zend_generate_anon_class_name(unsigned char *lex_pos) /* {{{
61366131}
61376132/* }}} */
61386133
6139- void zend_compile_class_decl (zend_ast * ast , zend_bool toplevel ) /* {{{ */
6134+ zend_op * zend_compile_class_decl (zend_ast * ast , zend_bool toplevel ) /* {{{ */
61406135{
61416136 zend_ast_decl * decl = (zend_ast_decl * ) ast ;
61426137 zend_ast * extends_ast = decl -> child [0 ];
@@ -6291,15 +6286,15 @@ void zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
62916286 }
62926287 CG (zend_lineno ) = ast -> lineno ;
62936288 zend_string_release (lcname );
6294- return ;
6289+ return NULL ;
62956290 }
62966291 }
62976292 } else {
62986293 if (EXPECTED (zend_hash_add_ptr (CG (class_table ), lcname , ce ) != NULL )) {
62996294 zend_string_release (lcname );
63006295 zend_build_properties_info_table (ce );
63016296 ce -> ce_flags |= ZEND_ACC_LINKED ;
6302- return ;
6297+ return NULL ;
63036298 }
63046299 }
63056300 }
@@ -6325,7 +6320,7 @@ void zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
63256320 zval zv ;
63266321 ZVAL_PTR (& zv , ce );
63276322 destroy_zend_class (& zv );
6328- return ;
6323+ return opline ;
63296324 }
63306325 } else {
63316326 zend_string * key = zend_build_runtime_definition_key (lcname , decl -> lex_pos );
@@ -6352,6 +6347,7 @@ void zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
63526347 opline -> opcode = ZEND_DECLARE_CLASS ;
63536348 }
63546349 }
6350+ return opline ;
63556351}
63566352/* }}} */
63576353
0 commit comments