Skip to content
Snippets Groups Projects
Commit 6756250f authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

c: Add some checking asserts to named loops handling code

Jonathan mentioned an unnamed static analyzer reported issue in
c_finish_bc_name.
It is actually a false positive, because the construction of the
loop_names vector guarantees that the last element of the vector
(if the vector is non-empty) always has either
C_DECL_LOOP_NAME (l) or C_DECL_SWITCH_NAME (l) (or both) flags
set, so c will be always non-NULL after the if at the start of the
loops.
The following patch is an attempt to help those static analyzers
(though dunno if it actually helps), by adding a checking assert.

2024-10-16  Jakub Jelinek  <jakub@redhat.com>

	* c-decl.cc (c_get_loop_names): Add checking assert that
	c is non-NULL in the loop.
	(c_finish_bc_name): Likewise.
parent f5224caf
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment