View Issue Details

IDProjectCategoryView StatusLast Update
0029860RunnerWindows (YYC)Public2019-01-31 10:54
ReporterSam CummingAssigned ToRussell Kay 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
PlatformWindowsOSWindows 10OS Version
Product Version2.1.5 
Target Version2.2.2Fixed in Version2.2.2 
Summary0029860: Windows (YYC): Decrementing prior to statement behaves differently compared to VM
DescriptionWith the below code, the roomspeed should be output at a constant 30.
In VM, the output is 30, however in YYC the output counts down and goes into negative numbers.

if(--object0.timer <= 0) // note decrement, breaks under YYC
    object0.timer += room_speed;

There is a difference in behaviour here between VM and YYC. Decrementing after a statement will work as expected.
Steps To Reproduce1. Open the attached project.
2. Run for Windows VM, observe that the output window shows constant 30.
3. Run for Windows YYC, observe that the output windows shows a countdown instead of constant 30.
TagsNo tags attached.
1.4 Found In
2.x Runtime Found In2.1.5.246
2.x Runtime Verified In2.2.2.302


Sam Cumming

2018-08-03 11:23


DecrementBug.yyz (21,156 bytes)

Stewart Bishop

2018-08-03 12:16

Developer   ~0061046

This is not a bug, you're constantly referencing object0 which in YYC is going to be an Alias so it's constantly going to be a different value if you do the following code:

with (object0) {
    if(--timer <= 0) { // note decrement, breaks under YYC
        timer += room_speed; // this line might as well not exist!

Then you don't get any issues.


2018-11-05 12:21

Adminstrator   ~0061943

Reopening, as we should aim to make VM and YYC consistent as much as possible and add compiler errors/syntax checks for when we absolutely cannot have consistency. Users should not have to go diagnosing this type of bug/not-bug if we know it is a language issue.

Russell Kay

2018-11-06 22:08

Manager   ~0061963

Fixed in gitlab - problem was that a new cache variables was being declared inside the inner block of the if, thus the storing of the variable after the decrement went to the inner variable and not the outer one. This caused the problem, compiler was changed to not redeclare variables that were already declared.