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

Comments

@sjinks
Copy link
Contributor

@sjinks 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

This comment has been minimized.

Copy link
Member

@sergeyklay 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 referenced this issue Oct 20, 2019
3 of 3 tasks complete
sergeyklay added a commit that referenced this issue Oct 20, 2019
 Fixed #1494
Zephir Bugs automation moved this from Low priority to Closed Oct 20, 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
sergeyklay added a commit that referenced this issue Nov 2, 2019
dreamsxin added a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
dreamsxin added a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
dreamsxin added a commit to dreamsxin/zephir that referenced this issue Nov 6, 2019
dreamsxin added 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
Zephir Bugs
  
Closed
2 participants
You can’t perform that action at this time.