zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.29k stars 466 forks source link

Generate correct `ARG_INFO` of getter #2386

Closed Jeckerson closed 1 year ago

Jeckerson commented 2 years ago

Current code:

protected transaction = null { get };

will generate incorrect ARG_INFO which will cause seg fault:

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_gettransaction, 0, 0, IS_NULL, 1)
ZEND_END_ARG_INFO()

It is impossible to have IS_NULL inside 4th argument of ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX it always must contain valid namespace class.

Jeckerson commented 1 year ago

Fixed in https://github.com/zephir-lang/zephir/issues/2387