Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zephir_update_static_property_ce_cache in the compiler #1494

Closed
sjinks opened this issue Apr 12, 2017 · 1 comment
Closed

zephir_update_static_property_ce_cache in the compiler #1494

sjinks opened this issue Apr 12, 2017 · 1 comment

Comments

@sjinks
Copy link
Contributor

sjinks commented Apr 12, 2017

StaticProperty::assignStatic:

if ($compilationContext->insideCycle) {
    $propertyCache = $compilationContext->symbolTable->getTempVariableForWrite('zend_property_info', $compilationContext);
    $propertyCache->setMustInitNull(true);
    $propertyCache->setReusable(false);
    $codePrinter->output('zephir_update_static_property_ce_cache(' . $classEntry .', SL("' . $property . '"), &' . $tempVariable->getName() . ', &' . $propertyCache->getName() . ' TSRMLS_CC);');
} else {
     $compilationContext->backend->updateStaticProperty($classEntry, $property, $tempVariable, $compilationContext);
}

However, zephir_update_static_property_ce_cache is available only in ZE2 kernel.

https://github.com/phalcon/zephir/blob/master/Library/Statements/Let/StaticProperty.php#L208
https://github.com/phalcon/zephir/blob/master/Library/Statements/Let/StaticProperty.php#L224

@sergeyklay
Copy link
Contributor

sergeyklay commented Oct 19, 2019

Code to reproduce:

namespace Bug;

class StaticPropertyAccess
{

    protected static doubleVar = 0.0;

    public static function mutateDoubleVarInsideCycle() -> double
    {
        var i;

        for _ in range(0, 3) {
            let i = 3.14;
            let self::doubleVar = i;
        }

        return self::doubleVar;
    }
}

sergeyklay added a commit that referenced this issue Oct 20, 2019
sergeyklay added a commit that referenced this issue Oct 20, 2019
sergeyklay added a commit that referenced this issue Oct 20, 2019
@sergeyklay sergeyklay mentioned this issue Oct 20, 2019
3 tasks
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
sergeyklay added a commit that referenced this issue Nov 2, 2019
dreamsxin pushed a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
dreamsxin pushed a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
dreamsxin pushed a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
dreamsxin pushed a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants