From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- tools/widl/header.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c index b7497e215d5..554b40fa46f 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -184,8 +184,9 @@ static void write_fields(FILE *h, var_list_t *fields, enum name_type name_type) }
LIST_FOR_EACH_ENTRY( v, fields, var_t, entry ) { - expr_t *contract = get_attrp(v->attrs, ATTR_CONTRACT); + expr_t *contract; if (!v || !v->declspec.type) continue; + contract = get_attrp(v->attrs, ATTR_CONTRACT); if (contract) write_apicontract_guard_start(h, contract);
indent(h, 0);
This merge request was approved by Huw Davies.
Alexandre Julliard (@julliard) commented about tools/widl/header.c:
} LIST_FOR_EACH_ENTRY( v, fields, var_t, entry ) {
expr_t *contract = get_attrp(v->attrs, ATTR_CONTRACT);
expr_t *contract; if (!v || !v->declspec.type) continue;
contract = get_attrp(v->attrs, ATTR_CONTRACT); if (contract) write_apicontract_guard_start(h, contract);
A list entry can never be NULL.
On Tue Jul 11 09:25:53 2023 +0000, Alexandre Julliard wrote:
A list entry can never be NULL.
Right... So the correct fix would be to remove the `!v` check, both here and in the previous loop.