On Tue, 17 Sep 2024, Martin Uecker wrote:

> Here is a fix for a mistake I made when recursively checking for
> type compatibility.
> 
> 
> Bootstrapped and regression tested on x86-64.
> 
> 
>     c: fix crash when checking for compatibility of structures [PR116726]
>     
>     When checking for compatibility of structure or union types in
>     tagged_types_tu_compatible_p, restore the old value of the pointer to
>     the top of the temporary cache after recursively calling 
> comptypes_internal
>     when looping over the members of a structure of union.  While the next
>     iteration of the loop overwrites the pointer, I missed the fact that it 
> can
>     be accessed again when types of function arguments are compared as part
>     of recursive type checking and the function is entered again.
>     
>             PR c/116726
>     
>     gcc/Changelog:
>             * c/c-typeck.cc (tagged_types_tu_compatible_p): Restore value
>             of the cache after recursing into comptypes_internal.
>     
>     gcc/testsuite/Changelog:
>             * pr116726.c: New test.

OK.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to