View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0023830||Runner||[All Projects] Functions||Public||2016-09-22 20:34||2021-08-06 15:38|
|Priority||None||Severity||D - Minor||Reproducibility||100%|
|Platform||Windows||OS||Windows 8||OS Version||8.1|
|Target Version||Fixed in Version|
|Summary||0023830: Functions: pre- and post- operators on data structures can have side effects but no one will notice|
|Description||Say, 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 Information||Priority set to lowest possible, since if you legitimately have this kind of structure in your code, you almost deserve it.|
|1.4 Found In||7.7.1288|
|2.x Runtime Found In|
|2.x Runtime Verified In|