com php-src: Disable JIT for PHPDBG: sapi/phpdbg/phpdbg.c
| From: | Dmitry Stogov | Date: | Tue, 21 Jul 2020 10:26:32 +0000 |
| Subject: | com php-src: Disable JIT for PHPDBG: sapi/phpdbg/phpdbg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112284@lists.php.net to get a copy of this message | ||
Commit: 047474c3b4dddd997ee3b8f66d0c4f091a40c02c
Author: Dmitry Stogov <dmitry@zend.com> Tue, 21 Jul 2020 13:26:32 +0300
Parents: 4ce9571978fef109f9fb6514658eeea63da6fddc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=047474c3b4dddd997ee3b8f66d0c4f091a40c02c
Log:
Disable JIT for PHPDBG
Changed paths:
M sapi/phpdbg/phpdbg.c
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 176ab4cb49..c0db5feda5 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -29,6 +29,7 @@
#include "phpdbg_print.h"
#include "phpdbg_help.h"
#include "phpdbg_arginfo.h"
+#include "zend_vm.h"
#include "ext/standard/basic_functions.h"
@@ -273,6 +274,17 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
/* deactivate symbol table caching to have these properly destroyed upon stack leaving (especially
important for watchpoints) */
EG(symtable_cache_limit) = EG(symtable_cache);
+ if (zend_vm_kind() != ZEND_VM_KIND_HYBRID) {
+ /* phpdbg cannot work JIT-ed code */
+ zend_string *key = zend_string_init(ZEND_STRL("opcache.jit"), 1);
+ zend_string *value = zend_string_init(ZEND_STRL("off"), 1);
+
+ zend_alter_ini_entry(key, value, ZEND_INI_SYSTEM, ZEND_INI_STAGE_STARTUP);
+
+ zend_string_release(key);
+ zend_string_release(value);
+ }
+
return SUCCESS;
} /* }}} */