PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+?? ??? ????, PHP 7.1.16
+
+- Core:
+ . Fixed bug #76025 (Segfault while throwing exception in error_handler).
+ (Dmitry, Laruence)
+
01 Feb 2018, PHP 7.1.15
- Apache2Handler:
--- /dev/null
+--TEST--
+Bug #76025 (Segfault while throwing exception in error_handler)
+--FILE--
+<?php
+
+function handleError($errno, $errstr, $errfile, $errline) {
+ $exception = new exception("blah");
+ throw $exception;
+}
+set_error_handler('handleError', E_ALL);
+$c = $b[$a];
+?>
+--EXPECTF--
+Fatal error: Uncaught Exception: blah in %sbug76025.php:%d
+Stack trace:
+#0 %sbug76025.php(%d): handleError(8, 'Undefined varia...', '%s', %d, Array)
+#1 {main}
+ thrown in %sbug76025.php on line %d
static zend_never_inline ZEND_COLD void zval_undefined_cv(uint32_t var, const zend_execute_data *execute_data)
{
- zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
-
- zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
+ if (EXPECTED(EG(exception) == NULL)) {
+ zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var));
+ zend_error(E_NOTICE, "Undefined variable: %s", ZSTR_VAL(cv));
+ }
}
static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type, const zend_execute_data *execute_data)