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.3k stars 466 forks source link

Generate correct `ARG_INFO` of getter #2386

Closed Jeckerson closed 2 years 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 2 years ago

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