Commit 50534b87 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Fix crash when trying to declare a fixed size array with a size_is attribute.

In this case type_array_get_conformance will return NULL. The code here is actually replacing an existing array with an EXPR_VOID conformance with the specified conformance, so issue an error if type_array_get_conformance returns NULL or the conformance has already been defined.
parent 096b3cd0
......@@ -1514,8 +1514,9 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
{
if (is_array(*ptype))
{
if (type_array_get_conformance(*ptype)->is_const)
error_loc("%s: cannot specify size_is for a fixed sized array\n", v->name);
if (!type_array_get_conformance(*ptype) ||
type_array_get_conformance(*ptype)->type != EXPR_VOID)
error_loc("%s: cannot specify size_is for an already sized array\n", v->name);
else
*ptype = type_new_array((*ptype)->name,
type_array_get_element(*ptype), FALSE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment