diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-07-27 12:04:50 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-07-28 14:09:05 +0200 |
commit | 94963965caa603e74f1d5cdfa3fce6f75a0455db (patch) | |
tree | 31354872fff70cf915c8bb03d3a0d69eb4871bd5 /libjava | |
parent | f0400e2a86888c08bbdba511f9abd2d4e7ba8e9e (diff) | |
download | gcc-94963965caa603e74f1d5cdfa3fce6f75a0455db.zip gcc-94963965caa603e74f1d5cdfa3fce6f75a0455db.tar.gz gcc-94963965caa603e74f1d5cdfa3fce6f75a0455db.tar.bz2 |
opts: Add an assertion to help static analyzers [PR106332]
This function would have UB if called with empty candidates vector
(accessing p[-1] where p is malloc (0) result).
As analyzed in the PR, we never call it with empty vector, so this just
adds an assertion to make it clear.
2022-07-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/106332
* opts-common.cc (candidates_list_and_hint): Add gcc_assert
that candidates is not an empty vector.
Diffstat (limited to 'libjava')
0 files changed, 0 insertions, 0 deletions