Skip to content

Commit 047474c

Browse files
committed
Disable JIT for PHPDBG
1 parent 4ce9571 commit 047474c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sapi/phpdbg/phpdbg.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "phpdbg_print.h"
3030
#include "phpdbg_help.h"
3131
#include "phpdbg_arginfo.h"
32+
#include "zend_vm.h"
3233

3334
#include "ext/standard/basic_functions.h"
3435

@@ -273,6 +274,17 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
273274
/* deactivate symbol table caching to have these properly destroyed upon stack leaving (especially important for watchpoints) */
274275
EG(symtable_cache_limit) = EG(symtable_cache);
275276

277+
if (zend_vm_kind() != ZEND_VM_KIND_HYBRID) {
278+
/* phpdbg cannot work JIT-ed code */
279+
zend_string *key = zend_string_init(ZEND_STRL("opcache.jit"), 1);
280+
zend_string *value = zend_string_init(ZEND_STRL("off"), 1);
281+
282+
zend_alter_ini_entry(key, value, ZEND_INI_SYSTEM, ZEND_INI_STAGE_STARTUP);
283+
284+
zend_string_release(key);
285+
zend_string_release(value);
286+
}
287+
276288
return SUCCESS;
277289
} /* }}} */
278290

0 commit comments

Comments
 (0)