From 2edefc21c48e33748b7dbe1131d113cda01db172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Sun, 28 Aug 2011 15:32:08 +0000 Subject: [PATCH] [WIDL] - duplicate type entry for parameters with the range attribute. This fixes the problem that Eric Kohl detected. This has already been sent to wine. svn path=/trunk/; revision=53480 --- reactos/tools/widl/parser.tab.c | 4 ++++ reactos/tools/widl/parser.y | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/reactos/tools/widl/parser.tab.c b/reactos/tools/widl/parser.tab.c index b7faf2874cd..1bc7eb5ffd3 100644 --- a/reactos/tools/widl/parser.tab.c +++ b/reactos/tools/widl/parser.tab.c @@ -5965,6 +5965,10 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl array_dims_t *arr = decl ? decl->array : NULL; type_t *func_type = decl ? decl->func_type : NULL; type_t *type = decl_spec->type; + + /* In case of a ranged type, duplicate it */ + if(is_attr(attrs, ATTR_RANGE)) + type = duptype(type, 1); if (is_attr(type->attrs, ATTR_INLINE)) { diff --git a/reactos/tools/widl/parser.y b/reactos/tools/widl/parser.y index ee708ea4394..a88d344240c 100644 --- a/reactos/tools/widl/parser.y +++ b/reactos/tools/widl/parser.y @@ -1417,6 +1417,11 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl array_dims_t *arr = decl ? decl->array : NULL; type_t *func_type = decl ? decl->func_type : NULL; type_t *type = decl_spec->type; + + /* In case of a range attribute, duplicate the type to keep track of + * the min/max values in the type format string */ + if(is_attr(attrs, ATTR_RANGE)) + type = duptype(type, 1); if (is_attr(type->attrs, ATTR_INLINE)) {