C++: Flow from parameters to ConstructorFieldInit

Because `ConstructorFieldInit` (member initializer lists) are not part
of the control flow graph, there was no data flow from the initial value
of parameters to their uses in member initializers. This commit adds the
necessary flow under the assumption that parameters are not overwritten
in member initializers.
This commit is contained in:
Jonas Jensen
2019-08-15 09:55:21 +02:00
parent 45eefdb218
commit 503cbf13bb
3 changed files with 43 additions and 2 deletions

View File

@@ -25,8 +25,8 @@ public:
void bar(Foo &f)
{
sink(f.a()); // flow (through `f` and `h`) [NOT DETECTED]
sink(f.b()); // flow (through `g` and `h`) [NOT DETECTED]
sink(f.a()); // flow (through `f` and `h`)
sink(f.b()); // flow (through `g` and `h`)
}
void foo()