C#: Add test that illustrates problem with flow through phi nodes

This commit is contained in:
Tom Hvitved
2021-01-12 10:06:12 +01:00
parent 36ad6b3432
commit 38b0f743cb
3 changed files with 34 additions and 0 deletions

View File

@@ -363,4 +363,22 @@ public class LocalDataFlow
Span<object> span = args; // flow (library operator)
LocalDataFlow x = args; // no flow (source code operator)
}
void PhiFlow(bool b1, bool b2)
{
var x = "";
if (b1)
{
x = "tainted";
if (b2)
{
Console.WriteLine(x);
return;
}
}
else
x = "not tainted";
Check(x);
}
}