analyzer: fix ICE casued by dup2 in sm-fd.cc[PR106551]
commit837142257cbde3cc03ee0dacd1d7b2fb4fa48bae
authorImmad Mir <mirimmad@outlook.com>
Thu, 11 Aug 2022 16:15:54 +0000 (11 21:45 +0530)
committerImmad Mir <mirimmad@outlook.com>
Thu, 11 Aug 2022 16:16:05 +0000 (11 21:46 +0530)
treeb9ce4bc7e40ab06f9a06fa664ce21eac0ab4c18c
parent04ce2400b35225302e0d6883bb0817378180f5d7
analyzer: fix ICE casued by dup2 in sm-fd.cc[PR106551]

This patch fixes the ICE caused by valid_to_unchecked_state,
at analyzer/sm-fd.cc by handling the m_start state in
check_for_dup.

Tested lightly on x86_64.

gcc/analyzer/ChangeLog:
PR analyzer/106551
* sm-fd.cc (check_for_dup): handle the m_start
state when transitioning the state of LHS
of dup, dup2 and dup3 call.

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/fd-dup-1.c: New testcases.
* gcc.dg/analyzer/fd-uninit-1.c: Remove bogus
warning.
Signed-off-by: Immad Mir <mirimmad@outlook.com>
gcc/analyzer/sm-fd.cc
gcc/testsuite/gcc.dg/analyzer/fd-dup-1.c
gcc/testsuite/gcc.dg/analyzer/fd-uninit-1.c