View Issue Details

IDProjectCategoryView StatusLast Update
0023830Runner[All Projects] FunctionsPublic2021-08-06 15:38
ReporterYellowAfterlifeAssigned ToCoreTech 
PriorityNoneSeverityD - MinorReproducibility100%
Status ResolvedResolutionSuspended 
PlatformWindowsOSWindows 8OS Version8.1
Product Version 
Target VersionFixed in Version 
Summary0023830: Functions: pre- and post- operators on data structures can have side effects but no one will notice
DescriptionSay, you have
/// func()
return ++global.index;

and once in a while want to use it for data structure access under unusual circumstances,
var value = list[|func()]++;

since this is compiled to
var value = ds_list_set_post(q, some(), q[|some()] + 1);

function call is made twice and produces side effects.

Ideally [someday] a separate function should be made to handle this, so that index-expression does not have to be duplicated.

Curiously, while exact same output is generated for HTML5, it behaves differently. Possibly due to argument processing order.
Additional InformationPriority set to lowest possible, since if you legitimately have this kind of structure in your code, you almost deserve it.
1.4 Found In7.7.1288
2.x Runtime Found In
2.x Runtime Verified In



2016-09-22 20:34


a_bug.gmz (119,287 bytes)