mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
C#: Update nullness analyses
Port the SSA-based logic from the Java nullness analyses.
This commit is contained in:
16
csharp/ql/src/CSI/NullMaybeGood.cs
Normal file
16
csharp/ql/src/CSI/NullMaybeGood.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
class Good
|
||||
{
|
||||
void DoPrint(object o)
|
||||
{
|
||||
if (o != null)
|
||||
Console.WriteLine(o.ToString());
|
||||
}
|
||||
|
||||
void M()
|
||||
{
|
||||
DoPrint("Hello");
|
||||
DoPrint(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user