Alexandre Julliard : widl: Check for mismatched types in ?: expressions.
Alexandre Julliard
julliard at winehq.org
Mon Jul 25 11:43:10 CDT 2011
Module: wine
Branch: master
Commit: 82f33d3f6be2e5088a48f5616ab3c4c312f3916d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=82f33d3f6be2e5088a48f5616ab3c4c312f3916d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jul 25 10:43:09 2011 +0200
widl: Check for mismatched types in ?: expressions.
---
tools/widl/expr.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/widl/expr.c b/tools/widl/expr.c
index 60e3a50..7012382 100644
--- a/tools/widl/expr.c
+++ b/tools/widl/expr.c
@@ -649,6 +649,10 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
check_scalar_type(expr_loc, cont_type, result_first.type);
result_second = resolve_expression(expr_loc, cont_type, e->u.ext);
result_third = resolve_expression(expr_loc, cont_type, e->ext2);
+ check_scalar_type(expr_loc, cont_type, result_second.type);
+ check_scalar_type(expr_loc, cont_type, result_third.type);
+ if (!is_ptr(result_second.type) ^ !is_ptr(result_third.type))
+ error_loc_info(&expr_loc->v->loc_info, "type mismatch in ?: expression\n" );
/* FIXME: determine the correct return type */
result = result_second;
result.is_variable = FALSE;
More information about the wine-cvs
mailing list