Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

zero const number inside condition iOS

Open M4rkY4 opened this issue 2 years ago • 1 comments

Hi, I've witnessed an annoying bug on iOS IPA build:

private static function doSomething():void
{
  if ( isBooleanConditionMet )
  {
    const someVariable:Number = 2.5;
    trace("variable = " + someVariable);// outputs "variable = 0"
  }
}

Each time I assign const number inside a condition on iOS non-debug builds, it assigns 0. On Android and on iOS debug (via usb cable) everything works as intended.

IntelliJ IDEA, AIR 33.1.1.821, many iOS devices, reproduces 100% times

Changing const to var fixes the issue. Moving const outside a condition fixes as well.

M4rkY4 avatar Jun 08 '22 14:06 M4rkY4

That's a very weird one! Likely due to the AOT compiler, we'll take a look...

thanks

ajwfrost avatar Jun 08 '22 16:06 ajwfrost