results in segfault).
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2004, PHP 5 RC 1
- Preserve class name casing for userspace classes. (Marcus)
+- Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload
+ results in segfault). (Marcus)
- Fixed bug #26695 (Reflection API does not recognize mixed-case class hints).
(Marcus)
- Fixed bug #26690 (make xsltProcessor->transformToUri use streams wrappers).
--- /dev/null
+--TEST--
+Bug #26697 (calling class_exists on a nonexistent class in __autoload results in segfault)
+--SKIPIF--
+<?php if (function_exists('__autoload')) die('skip __autoload() declared in auto_prepend_file');?>
+--FILE--
+<?php
+
+function __autoload($name)
+{
+ echo __METHOD__ . "($name)\n";
+ var_dump(class_exists('NotExistingClass'));
+ echo __METHOD__ . "($name), done\n";
+}
+
+var_dump(class_exists('NotExistingClass'));
+
+?>
+===DONE===
+--EXPECTF--
+__autoload(NotExistingClass)
+bool(false)
+__autoload(NotExistingClass), done
+bool(false)
+===DONE===
EG(user_error_handler) = NULL;
EG(user_exception_handler) = NULL;
EG(in_execution) = 0;
+ EG(in_autoload) = 0;
EG(current_execute_data) = NULL;
}
EG(class_table) = CG(class_table);
EG(in_execution) = 0;
+ EG(in_autoload) = 0;
zend_ptr_stack_init(&EG(argument_stack));
return SUCCESS;
}
+ if (EG(in_autoload)) {
+ free_alloca(lc_name);
+ return FAILURE;
+ }
+ EG(in_autoload) = 1;
+
ZVAL_STRINGL(&autoload_function, "__autoload", sizeof("__autoload")-1, 0);
INIT_PZVAL(class_name_ptr);
EG(exception) = NULL;
retval = call_user_function_ex(EG(function_table), NULL, &autoload_function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
+ EG(in_autoload) = 0;
+
if (retval == FAILURE) {
EG(exception) = exception;
free_alloca(lc_name);
int ticks_count;
zend_bool in_execution;
+ zend_bool in_autoload;
zend_bool bailout_set;
zend_bool full_tables_cleanup;
zend_bool implicit_clone;