Jacek Caban (@jacek) commented about dlls/vbscript/interp.c:
/* FIXME: We should check if we're not modifying an existing static array here */
v = ref.u.v;
if(V_VT(v) == (VT_VARIANT|VT_BYREF)) { v = V_VARIANTREF(v); }
- if(V_ISARRAY(v)) {
SAFEARRAY *sa = V_ISBYREF(v) ? *V_ARRAYREF(v) : V_ARRAY(v);
if(sa->fFeatures & FADF_FIXEDSIZE)
{
SafeArrayDestroy(array);
return MAKE_VBSERROR(VBSE_ARRAY_LOCKED);
}
- }
I think this should be checked earlier, before `array_bounds_from_stack()` call. This would avoid creating the new array and my testing confirms that's what Windows does (if I try to use "abc" as redim argument, VBSE_ARRAY_LOCKED is still returned on Windows rather than `to_int()` error).