@@ -2178,11 +2178,9 @@ static zend_op *zend_delayed_compile_end(uint32_t offset) /* {{{ */
2178
2178
2179
2179
ZEND_ASSERT (count >= offset );
2180
2180
for (i = offset ; i < count ; ++ i ) {
2181
- opline = get_next_op ();
2182
- memcpy (opline , & oplines [i ], sizeof (zend_op ));
2183
- if (opline -> opcode == ZEND_JMP_NULL ) {
2184
- uint32_t opnum = get_next_op_number () - 1 ;
2185
- zend_stack_push (& CG (short_circuiting_opnums ), & opnum );
2181
+ if (oplines [i ].opcode != ZEND_NOP ) {
2182
+ opline = get_next_op ();
2183
+ memcpy (opline , & oplines [i ], sizeof (zend_op ));
2186
2184
}
2187
2185
}
2188
2186
@@ -2826,11 +2824,18 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
2826
2824
2827
2825
zend_separate_if_call_and_write (& obj_node , obj_ast , type );
2828
2826
if (nullsafe ) {
2829
- /* We will push to the short_circuiting_opnums stack in zend_delayed_compile_end(). */
2830
- opline = zend_delayed_emit_op (NULL , ZEND_JMP_NULL , & obj_node , NULL );
2831
- if (opline -> op1_type == IS_CONST ) {
2832
- Z_TRY_ADDREF_P (CT_CONSTANT (opline -> op1 ));
2827
+ /* Flush delayed oplines */
2828
+ zend_op * opline = NULL , * oplines = zend_stack_base (& CG (delayed_oplines_stack ));
2829
+ uint32_t i , count = zend_stack_count (& CG (delayed_oplines_stack ));
2830
+
2831
+ for (i = 0 ; i < count ; ++ i ) {
2832
+ if (oplines [i ].opcode != ZEND_NOP ) {
2833
+ opline = get_next_op ();
2834
+ memcpy (opline , & oplines [i ], sizeof (zend_op ));
2835
+ oplines [i ].opcode = ZEND_NOP ;
2836
+ }
2833
2837
}
2838
+ zend_emit_jmp_null (& obj_node );
2834
2839
}
2835
2840
}
2836
2841
0 commit comments