You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
There is a problem when using the new instance operator. I believe I finally tracked down the issue that required the fix phalcon/cphalcon#14238 in cphalcon. I'm not familiar with the source code for the php interpreter or zephir, so please bear with me.
Currently, when using the new {classname}() operator in zep files, the following C code is generated.
The problem is that the function zephir_fetch_class_str_ex will return NULL if the autoloaded class as a syntax error. This goes unchecked when passing it into object_init_ex which expects the handler to be valid since there isn't any guard in place.
That's why using zephir_create_instance() instead of new {classname}() doesn't cause a segfault.
Hopefully someone with more knowledge of Zephir can implement this fix. If not, I should be able to work on it in a few weeks. I'm working on a patch for this right now.
The text was updated successfully, but these errors were encountered:
Hello,
There is a problem when using the new instance operator. I believe I finally tracked down the issue that required the fix phalcon/cphalcon#14238 in cphalcon. I'm not familiar with the source code for the php interpreter or zephir, so please bear with me.
Currently, when using the
new {classname}()
operator inzep
files, the following C code is generated.The problem is that the function
zephir_fetch_class_str_ex
will returnNULL
if the autoloaded class as a syntax error. This goes unchecked when passing it intoobject_init_ex
which expects the handler to be valid since there isn't any guard in place.That's why using
zephir_create_instance()
instead ofnew {classname}()
doesn't cause a segfault.Hopefully someone with more knowledge of Zephir can implement this fix. If not, I should be able to work on it in a few weeks.I'm working on a patch for this right now.The text was updated successfully, but these errors were encountered: