On Wed, 16 May 2012 05:45:05 +0200, Yader Hernandez
<yader.hernan...@gmail.com> wrote:
I'm calling this function:
static zend_class_entry *create_class_entry_runtime_exception(TSRMLS_C) {
zend_class_entry **pce;
if (zend_hash_find(CG(class_table), "runtimeexception",
sizeof("RuntimeException"), (void **) &pce) == SUCCESS) {
return *pce;
}
}
but it's causing a segfault.
The function is being called in PHP_MINIT_FUNCTION and assigning the
return value to a static zend_class_entry *runtime_exception_ptr
My final goal is to be able to easily call zend_throw_exception and
pass runtime_exception_ptr pointer.
For the RuntimeException class entry, you can just include
<ext/spl/spl_exceptions.h> and use spl_ce_RuntimeException.
When the pointer is not exported, you can use zend_lookup_class_ex().
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php