C#: Fix completely broken type argument extraction in NoMetadataHandleType

This commit is contained in:
Tamas Vajk
2021-08-31 14:34:27 +02:00
parent c8a5397085
commit b267d26ff8
2 changed files with 2 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ namespace Semmle.Extraction.CIL.Entities
// "T3,[T4, Assembly1, Version=...],T5,T6"
string typeArgs;
(name, _, typeArgs, _) = name.Split(firstBracketIndex, firstBracketIndex + 1, lastBracketIndex - firstBracketIndex - 1);
(name, _, typeArgs, _) = name.Split(firstBracketIndex, firstBracketIndex + 1, lastBracketIndex);
var thisTypeArgCount = GenericsHelper.GetGenericTypeParameterCount(name);
if (thisTypeArgCount == 0)

View File

@@ -20,7 +20,7 @@ namespace Semmle.Util
public static (string, string, string, string) Split(this string self, int index0, int index1, int index2)
{
var split = self.Split(new[] { index0, index1, index2 });
return (split[0], split[1], split[2], split[4]);
return (split[0], split[1], split[2], split[3]);
}
private static List<string> Split(this string self, params int[] indices)