]> granicus.if.org Git - php/commitdiff
Fixed tracing JIT type inference for passing undefined CV by value
authorDmitry Stogov <dmitry@zend.com>
Thu, 28 May 2020 15:35:32 +0000 (18:35 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 28 May 2020 15:35:32 +0000 (18:35 +0300)
ext/opcache/jit/zend_jit_trace.c

index 41409dd953814769d7a2da6c478cf2c825d394ae..fd692b5ebc9fc679a7c9b6eb5b99feca90aeabfb 100644 (file)
@@ -3125,6 +3125,9 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
                                                        if (opline->op1_type == IS_CONST) {
                                                                zend_jit_trace_send_type(opline, frame->call, Z_TYPE_P(RT_CONSTANT(opline, opline->op1)));
                                                        } else if (op1_type != IS_UNKNOWN) {
+                                                               if (op1_type == IS_UNDEF) {
+                                                                       op1_type = IS_NULL;
+                                                               }
                                                                zend_jit_trace_send_type(opline, frame->call, op1_type);
                                                        }
                                                }
@@ -3169,6 +3172,9 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
                                                                goto done;
                                                        }
                                                        if (op1_type != IS_UNKNOWN) {
+                                                               if (op1_type == IS_UNDEF) {
+                                                                       op1_type = IS_NULL;
+                                                               }
                                                                zend_jit_trace_send_type(opline, frame->call, op1_type);
                                                        }
                                                }