Skip to contentSkip to conversation

--no-loops

Cocci Nicholas Mc Guire 2 participants 2 messages Feb 15, 2016 – Feb 18, 2016

lore
Share & tools
lore
#0 lore raw

Hi !

--no-loops is documented as:
<snip>
--no-loops
drop all back edges derived from looping constructs - unsafe
<snip>

the background is that some scanners will simply not make any progress (e.g. linux-next/lib/rbtree.c:__rb_insert() is a perfect "hang" without --no-loops for even simple scanners

what exactly does unsafe here mean ?

thx!
hofrat

#1 lore raw
Quoted 9 lines · Nicholas Mc Guire

Hi !

--no-loops is documented as:
<snip>
--no-loops
drop all back edges derived from looping constructs - unsafe
<snip>

Quoted 5 lines

the background is that some scanners will simply not make any progress (e.g. linux-next/lib/rbtree.c:__rb_insert() is a perfect "hang" without --no-loops for even simple scanners

what exactly does unsafe here mean ?

The correctness of a rules might require following back edges. For example,

a();
... when != b();

in code like

while (x) {
b();
a();
}
return;

With --no-loops, the rule above would match, while with loops taken into account it should not.

julia