]> gcc.gnu.org Git - gcc.git/commit
gensupport: Don't segfault on empty attrs list
authorTamar Christina <tamar.christina@arm.com>
Fri, 4 Aug 2023 12:48:56 +0000 (13:48 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 4 Aug 2023 12:48:56 +0000 (13:48 +0100)
commit6b80071a4d05c9535d3bb26cddaed0895a414f59
tree16da58ed8edfbd5357e93b5b63cc207b1bca816a
parent8787b195f014883a2d2454faf2001303dfefef8c
gensupport: Don't segfault on empty attrs list

Currently we segfault when len == 0 for an attribute list.

essentially [cons: =0, 1, 2, 3; attrs: ] segfaults but should be equivalent to
[cons: =0, 1, 2, 3] and [cons: =0, 1, 2, 3; attrs:].  This fixes it by just
returning early and leaving it to the validators whether this should error out
or not.

gcc/ChangeLog:

* gensupport.cc (conlist): Support length 0 attribute.
gcc/gensupport.cc
This page took 0.059745 seconds and 5 git commands to generate.