d: Fix ICE in uda_attribute_p when looking up unknown attribute
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 23 Jun 2020 14:25:29 +0000 (16:25 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 25 Jun 2020 15:02:45 +0000 (17:02 +0200)
commit62e02c8729a75c4a859edc18e0bcafb87d717f46
treecf7051a6aaeaef1e2467964429440e81124363df
parenteacfafbc3534fb32782934d765d21855dff32e56
d: Fix ICE in uda_attribute_p when looking up unknown attribute

The target attribute table is not guaranteed to be set in all backends.

gcc/d/ChangeLog:

PR d/95173
* d-attribs.cc (uda_attribute_p): Don't search target attribute table
if NULL.

gcc/testsuite/ChangeLog:

PR d/95173
* gdc.dg/pr95173.d: New test.
gcc/d/d-attribs.cc
gcc/testsuite/gdc.dg/pr95173.d [new file with mode: 0644]