mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Fix labeled stmt factory method parameter types
This commit is contained in:
@@ -6,17 +6,18 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
||||
{
|
||||
internal class Labeled : Statement<LabeledStatementSyntax>
|
||||
{
|
||||
private readonly Statement parent;
|
||||
private readonly IStatementParentEntity parent;
|
||||
private readonly int child;
|
||||
private Statement labelledStmt;
|
||||
|
||||
private Labeled(Context cx, LabeledStatementSyntax stmt, Statement parent, int child)
|
||||
private Labeled(Context cx, LabeledStatementSyntax stmt, IStatementParentEntity parent, int child)
|
||||
: base(cx, stmt, StmtKind.LABEL, parent, child)
|
||||
{
|
||||
this.parent = parent;
|
||||
this.child = child;
|
||||
}
|
||||
|
||||
public static Labeled Create(Context cx, LabeledStatementSyntax node, Statement parent, int child)
|
||||
public static Labeled Create(Context cx, LabeledStatementSyntax node, IStatementParentEntity parent, int child)
|
||||
{
|
||||
var ret = new Labeled(cx, node, parent, child);
|
||||
ret.TryPopulate();
|
||||
@@ -27,13 +28,11 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
||||
{
|
||||
trapFile.exprorstmt_name(this, Stmt.Identifier.ToString());
|
||||
|
||||
// For compatilibty with the Mono extractor, make insert the labelled statement into the same block
|
||||
// For compatibility with the Mono extractor, make insert the labelled statement into the same block
|
||||
// as this one. The parent MUST be a block statement.
|
||||
labelledStmt = Statement.Create(cx, Stmt.Statement, parent, child + 1);
|
||||
}
|
||||
|
||||
private Statement labelledStmt;
|
||||
|
||||
public override int NumberOfStatements => 1 + labelledStmt.NumberOfStatements;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user