View Issue Details

IDProjectCategoryView StatusLast Update
0031415RunnerFunctionsPublic2019-11-15 12:10
ReporterYellowAfterlifeAssigned ToRussell Kay 
PriorityVery LowSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
PlatformWindowsOSWindows 10 ProOS Version>=18362
Product Version2.2.4 
Target Version2.2.5Fixed in Version2.2.5 
Summary0031415: Functions: argument[@<ind>] compiles and then crashes on VM, produces invalid C++ on YYC
DescriptionSuppose you have a script and did
show_debug_message(argument[0]);
argument[@0]++;
show_debug_message(argument[@0]);

for VM, this faithfully generates an equivalent of
show_debug_message(argument[0]);
array_set_post(argument, 0, array_get(argument, 0) + 1);
show_debug_message(array_get(argument, 0));

(and then dies when you try to run it because no index is provided)

on YYC, this omits "args" at all, so your code is invalid
YY_STACKTRACE_LINE(2);
FREE_RValue( &__ret1__ );
FREE_RValue( &__ret2__ );
YYRValue __arg12__((YYGML_array_get(__ret2__,,0) + 1)); // <- ",,"
YYRValue* __pArg13__[]={&, (YYRValue*)&gs_constArg0_0BD0FE49, &__arg12__};
YYGML_CallLegacyFunction(pSelf,pOther,__ret1__,3,g_FUNC_array_set_post.val,__pArg13__);

YY_STACKTRACE_LINE(4);
FREE_RValue( &__ret1__ );
YYGML_show_debug_message(YYGML_array_get(__ret1__,,0)); // <- ",,"


It'd be nice to have a compile-time error instead when trying to do any accessors on `argument`
Tagsfunctions
1.4 Found In
2.x Runtime Found In9.9.1.1583
2.x Runtime Verified In2.2.5.375

Activities

YellowAfterlife

2019-10-08 09:32

Developer  

a_bug.yyz (18,405 bytes)

Russell Kay

2019-10-11 12:19

Manager   ~0064963

Fixed in gitlab

Alice

2019-11-15 12:10

Adminstrator   ~0065124

Verified fixed on IDE v2.2.5.475 Runtime v2.2.5.375. Closing the bug.

However, the manual does not specify that accessors cannot be used with arguments and may be worth clarifying that in the documentation.

Thank you.