-
Notifications
You must be signed in to change notification settings - Fork 14
/
descr
24 lines (17 loc) · 938 Bytes
/
descr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
detects an unused result of a function with warn-unused-result attribute
Ensures the usage of a value returned by a function
that is tagged wih the GNU warn-unused-result attribute.
The Algorithm
================
We use the Primus Taint analysis engine to propagate the taint from the
return argument of a function that has warn-unused attribute. We
sanitize taint (thus indicating that the value was used when one of
the following happens):
1) some control flow depends on the tainted value, i.e.,
a taint reaches the condition of a jump term;
2) the taint reaches a function with an external linkage.
To catch the unused values as soon as possible, we enable the
conservative Primus taint garbage collector that notifies us when a
taint is no longer reachable (and thus has no chance on sanitizing).
Finally, when analysis finishes, we indicate all functions
that weren't sanitized as unused, even if their taint still alive.