mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
30 lines
445 B
C#
30 lines
445 B
C#
using System;
|
|
|
|
class StaticFields
|
|
{
|
|
static int staticField;
|
|
int instanceField;
|
|
|
|
static StaticFields()
|
|
{
|
|
staticField = 0; // OK
|
|
}
|
|
|
|
StaticFields()
|
|
{
|
|
staticField = 0; // BAD
|
|
instanceField = 0; // OK
|
|
}
|
|
|
|
static void StaticTest()
|
|
{
|
|
staticField = 0; // OK
|
|
}
|
|
|
|
void InstanceTest()
|
|
{
|
|
staticField = 0; // BAD
|
|
instanceField = 0; // OK
|
|
}
|
|
}
|