summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2013-09-29 17:58:25 +0200
committerNikita Popov <nikic@php.net>2013-09-29 17:58:25 +0200
commitf0c926564c5f7de9462d9ca7bd75014b14a63f56 (patch)
tree51a9315696c4ffd0ccbdd9c1e0dd0b0cfc97d821 /Zend/zend.c
parentd143c2b60f87f5cd221bd070bfde887374b74eb4 (diff)
downloadphp-git-f0c926564c5f7de9462d9ca7bd75014b14a63f56.tar.gz
Fix bug #65322: compile time errors won't trigger auto loading
Also fixes duplicate bugs #54054 and #42098. Furthermore this fixes incorrect error messages thrown from code running inside an error handler when a compilation is in progress. The error file and line are now correctly associated with the file/line of the executor, rather than the compiler.
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 162922866b..0602c45042 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1183,7 +1183,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
* such scripts recursivly, but some CG() variables may be
* inconsistent. */
- in_compilation = zend_is_compiling(TSRMLS_C);
+ in_compilation = CG(in_compilation);
if (in_compilation) {
saved_class_entry = CG(active_class_entry);
CG(active_class_entry) = NULL;
@@ -1195,6 +1195,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
SAVE_STACK(declare_stack);
SAVE_STACK(list_stack);
SAVE_STACK(context_stack);
+ CG(in_compilation) = 0;
}
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
@@ -1219,6 +1220,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
RESTORE_STACK(declare_stack);
RESTORE_STACK(list_stack);
RESTORE_STACK(context_stack);
+ CG(in_compilation) = 1;
}
if (!EG(user_error_handler)) {