Skip to content

Instantly share code, notes, and snippets.

@laruence
Created February 28, 2018 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laruence/68ef57e8296d2333c7eb48b42830454a to your computer and use it in GitHub Desktop.
Save laruence/68ef57e8296d2333c7eb48b42830454a to your computer and use it in GitHub Desktop.
diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt
index f89c49e..c955d18 100644
--- a/Zend/tests/024.phpt
+++ b/Zend/tests/024.phpt
@@ -19,8 +19,6 @@ Notice: Undefined variable: a in %s on line %d
NULL
Notice: Undefined variable: %s in %s on line %d
-
-Notice: Undefined variable: %s in %s on line %d
NULL
Notice: Undefined variable: a in %s on line %d
diff --git a/Zend/tests/bug76025.phpt b/Zend/tests/bug76025.phpt
new file mode 100644
index 0000000..2619984
--- /dev/null
+++ b/Zend/tests/bug76025.phpt
@@ -0,0 +1,18 @@
+--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
diff --git a/Zend/tests/isset_003.phpt b/Zend/tests/isset_003.phpt
index 92225b5..e3357f9 100644
--- a/Zend/tests/isset_003.phpt
+++ b/Zend/tests/isset_003.phpt
@@ -31,8 +31,6 @@ bool(false)
Notice: Undefined variable: c in %s on line %d
-Notice: Undefined variable: d in %s on line %d
-
Notice: Trying to get property of non-object in %s on line %d
bool(false)
bool(true)
diff --git a/Zend/tests/isset_003_2_4.phpt b/Zend/tests/isset_003_2_4.phpt
index 42d8cc6..477ac5c 100644
--- a/Zend/tests/isset_003_2_4.phpt
+++ b/Zend/tests/isset_003_2_4.phpt
@@ -33,8 +33,6 @@ bool(false)
Notice: Undefined variable: c in %s on line %d
-Notice: Undefined variable: d in %s on line %d
-
Notice: Trying to get property of non-object in %s on line %d
bool(false)
bool(true)
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index a420a82..5b95b7c 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1884,8 +1884,7 @@ try_string_offset:
} else {
if (type != BP_VAR_IS && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
zval_undefined_cv(EG(current_execute_data)->opline->op1.var, EG(current_execute_data));
- }
- if (/*dim_type == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
+ } else if (/*dim_type == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
zval_undefined_cv(EG(current_execute_data)->opline->op2.var, EG(current_execute_data));
}
ZVAL_NULL(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment