[5/8] widl: dereference operator in expr work on any declared pointer
Rob Shearman
robertshearman at gmail.com
Sat Jan 10 16:41:30 CST 2009
2009/1/10 Michael Karcher <wine at mkarcher.dialup.fu-berlin.de>:
> If we take MIDL 6.00.0366 as reference, the following method type is
> legal:
>
> void frobnicate([size_is(x),in,out] int * bar1,
> [size_is(*bar1),out] int * bar2,
> [in] int x);
>
> Without this patch, size_is(*bar1) would be rejected.
> ---
> tools/widl/expr.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/widl/expr.c b/tools/widl/expr.c
> index 7f0e26d..e943062 100644
> --- a/tools/widl/expr.c
> +++ b/tools/widl/expr.c
> @@ -468,8 +468,8 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
> break;
> case EXPR_PPTR:
> result = resolve_expression(expr_loc, cont_type, e->ref);
> - if (result.type && is_ptr(result.type))
> - result.type = type_pointer_get_ref(result.type);
> + if (result.type && is_declptr(result.type))
> + result.type = get_deref_type(result.type);
> else
> error_loc_info(&expr_loc->v->loc_info, "dereference operator applied to non-pointer type in expression%s%s\n",
> expr_loc->attr ? " for attribute " : "",
Looks good, once you expand the dubious functions used here. Also, can
you add a test for this in dlls/rpcrt4/tests/server.c?
--
Rob Shearman
More information about the wine-devel
mailing list