https://bugs.winehq.org/show_bug.cgi?id=53767
--- Comment #3 from Robert Wilhelm sloper42@yahoo.com --- Jason, as proof of concept, I hacked together some random lines which I think is along Nikolay's suggestion.
It needs quite some cleanup, as there is no error handling and no handling of multidimensional arrays. We could also make use of already existing helper funtions.
At least my testcase works with it.
Const tnob = 5 ' total number of balls ReDim rolling(tnob) rolling(2) = 3 MsgBox rolling(2)
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index c43b5383dee..0b9d86ce864 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -1297,8 +1306,20 @@ static HRESULT interp_redim(exec_ctx_t *ctx) }
if(ref.type != REF_VAR) { - FIXME("got ref.type = %d\n", ref.type); - return E_FAIL; + int dim; + ctx->func->array_cnt++; + array_desc_t *array_desc; + array_desc = (array_desc_t *)malloc (sizeof(array_desc_t)); + array_desc->dim_cnt = 1; + array_desc->bounds = (SAFEARRAYBOUND *) malloc(sizeof(SAFEARRAYBOUND)); + to_int(stack_top(ctx, 0), &dim); + stack_popn(ctx, 1); + array_desc->bounds->cElements = dim; + array_desc->bounds->lLbound = 0; + ctx->func->array_descs = array_desc; + VARIANT *new; + hres = add_dynamic_var(ctx, identifier, FALSE, &new); + return interp_dim(ctx); }
hres = array_bounds_from_stack(ctx, dim_cnt, &bounds);