mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
Fixed possible crash because of dereference of NULL
This commit is contained in:
parent
09de519e79
commit
5a695e9f32
@ -1801,22 +1801,20 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
|
||||
|
||||
if (expr) {
|
||||
opline->op1 = *expr;
|
||||
} else {
|
||||
opline->op1.op_type = IS_CONST;
|
||||
INIT_ZVAL(opline->op1.u.constant);
|
||||
}
|
||||
|
||||
if (do_end_vparse) {
|
||||
if (zend_is_function_or_method_call(expr)) {
|
||||
opline->extended_value = ZEND_RETURNS_FUNCTION;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
} else if (CG(active_op_array)->return_reference &&
|
||||
expr && expr->u.EA.type == ZEND_PARSED_NEW) {
|
||||
expr->u.EA.type == ZEND_PARSED_NEW) {
|
||||
opline->extended_value = ZEND_RETURNS_NEW;
|
||||
zend_error(E_STRICT, "Returning the return value of new by reference is deprecated");
|
||||
}
|
||||
} else {
|
||||
opline->op1.op_type = IS_CONST;
|
||||
INIT_ZVAL(opline->op1.u.constant);
|
||||
}
|
||||
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user