1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00

Check for undef variable exception in SEND_VAR JIT

Add a return value to zend_jit_undefined_op_helper(), so we can
check for exception based on the return value, instead of fetching
EG(exception).
This commit is contained in:
Nikita Popov
2020-07-07 15:22:46 +02:00
parent cdc4ea2a5c
commit 0e6ec974fb
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -278,12 +278,13 @@ static zval* ZEND_FASTCALL zend_jit_symtable_lookup_w(HashTable *ht, zend_string
return retval;
}
static void ZEND_FASTCALL zend_jit_undefined_op_helper(uint32_t var)
static int ZEND_FASTCALL zend_jit_undefined_op_helper(uint32_t var)
{
const zend_execute_data *execute_data = EG(current_execute_data);
zend_string *cv = EX(func)->op_array.vars[EX_VAR_TO_NUM(var)];
zend_error(E_WARNING, "Undefined variable $%s", ZSTR_VAL(cv));
return EG(exception) == NULL;
}
static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim, zval *result)
+2
View File
@@ -9235,6 +9235,8 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
| mov FCARG1d, opline->op1.var
| EXT_CALL zend_jit_undefined_op_helper, r0
| SET_ZVAL_TYPE_INFO arg_addr, IS_NULL
| test r0, r0
| jz ->exception_handler
if (op1_info & (MAY_BE_ANY|MAY_BE_REF)) {
| jmp >7