View Issue Details

IDProjectCategoryView StatusLast Update
0031525RunnerWindows (YYC)Public2019-12-11 14:00
ReporterYellowAfterlifeAssigned ToRussell Kay 
PriorityLowSeverityC - GeneralReproducibility100%
Status ResolvedResolutionWon't Fix 
PlatformWindowsOSWindows 10 ProOS Version>=18362
Product Version 
Target VersionFixed in Version 
Summary0031525: YYC: obj_name.field read caches in spite of subsequent write operations
Description
instance_create_depth(0, 0, 0, obj_test); // defaults `value` to `noone`
if (obj_test.value == noone) {
    with (obj_test) value = "Hello!";
    show_debug_message("Changed value to Hello!");
}
show_debug_message(obj_test.value);

will print -4 even after changing the value, since the retrieved value from line 2 is reused for line 6 read.
Additional InformationIn original encounter, event_perform was used to trigger init, and I thought that event_perform might be considered "pure" (side effect-free), but turns out that it's simpler than that.
Tagsyyc
1.4 Found In
2.x Runtime Found In9.9.1.1630
2.x Runtime Verified In

Activities

YellowAfterlife

2019-11-28 20:25

Developer  

a_bug.yyz (17,843 bytes)

Russell Kay

2019-12-11 14:00

Manager   ~0065206

This is a limitation on YYC it cannot handling the aliasing issues, to keep the speed higher then it cannot keep track of the variable being changed when it has been referenced in a different manner - if it had been changed in another function then it should be discarded but if it is changed in the same function but just referenced in a different way.

The current YYC compiler cannot handle the aliasing of the variables in this way (particularly the obj_name.field syntax, which I would strongly discourage the usage of), this is something we are changing with the new compiler - but it is a known limitation with the current one.