mirror of
https://github.com/github/codeql.git
synced 2026-04-22 15:25:18 +02:00
C#: Fix extractor errors.
This commit is contained in:
@@ -142,10 +142,9 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
// Sadly, these properties are internal so cannot be accessed directly.
|
||||
// This seems to be a deficiency in the model.
|
||||
var readonlyProperty = nt.GetType().GetProperty("IsReadOnly", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var isByRefProperty = nt.GetType().GetProperty("IsByRefLikeType", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
bool isReadOnly = (bool)readonlyProperty.GetValue(nt);
|
||||
bool isByRefLikeType = (bool)isByRefProperty.GetValue(nt);
|
||||
bool isByRefLikeType = nt.IsRefLikeType;
|
||||
|
||||
if (isReadOnly)
|
||||
HasModifier(cx, key, "readonly");
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
var nts = (NullableTypeSyntax)Syntax;
|
||||
var nt = (NamedType)Type;
|
||||
Emit(Loc ?? Syntax.GetLocation(), Parent, Type);
|
||||
Create(cx, nts.ElementType, this, nt.TypeArguments[0]);
|
||||
Create(cx, nts.ElementType, this, nt.symbol.IsReferenceType ? nt : nt.TypeArguments[0]);
|
||||
return;
|
||||
case SyntaxKind.TupleType:
|
||||
var tts = (TupleTypeSyntax)Syntax;
|
||||
|
||||
Reference in New Issue
Block a user