]> granicus.if.org Git - php/commitdiff
Bad function detection
authorDmitry Stogov <dmitry@zend.com>
Thu, 9 Jul 2020 14:24:35 +0000 (17:24 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 9 Jul 2020 14:24:35 +0000 (17:24 +0300)
ext/opcache/jit/zend_jit_vm_helpers.c

index c7c7afba9d01409679e3c88b1883c4238c94d8cb..9e52c47be7dec1758ba79846b3b7f8d51bf1641c 100644 (file)
@@ -475,7 +475,7 @@ static int zend_jit_trace_record_fake_init_call_ex(zend_execute_data *call, zend
                }
 
                func = call->func;
-               if (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
+               if (func->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE)) {
                        /* TODO: Can we continue recording ??? */
                        return -1;
                }
@@ -855,6 +855,10 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
                                        /* TODO: Can we continue recording ??? */
                                        stop = ZEND_JIT_TRACE_STOP_TRAMPOLINE;
                                        break;
+                               } else if (EX(call)->func->common.fn_flags & ZEND_ACC_NEVER_CACHE) {
+                                       /* TODO: Can we continue recording ??? */
+                                       stop = ZEND_JIT_TRACE_STOP_BAD_FUNC;
+                                       break;
                                }
                                func = EX(call)->func;
                                if (func->type == ZEND_USER_FUNCTION