[5/8] widl: dereference operator in expr work on any declared pointer
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 " : "", -- 1.5.6.5
2009/1/10 Michael Karcher <wine(a)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
Am Samstag, den 10.01.2009, 22:41 +0000 schrieb Rob Shearman:
2009/1/10 Michael Karcher <wine(a)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);
Also, can you add a test for this in dlls/rpcrt4/tests/server.c?
Yes, of course. I didn't know that a widl test existed. Would be *really* great if the crosstest of this test could use MIDL generated client/server code instead of WIDL one, but when I tried some time ago it looked like getting MIDL to run in Wine needs some work. If I write a test for void frobnicate([size_is(x),in,out] int * bar1, [size_is(*bar1),out] int bar2[], [in] int x); instead, I can also test that bar1 is null-pointer-checked while bar2 gets away with being NULL as long as *bar1 is 0 on exit of the function. This is what [6/8] fixes in widl. Regards, Michael Karcher
participants (2)
-
Michael Karcher -
Rob Shearman