Fixed possible crash because of dereference of NULL

This commit is contained in:
Dmitry Stogov 2007-02-01 15:24:10 +00:00
parent 09de519e79
commit 5a695e9f32

View File

@ -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);
}