We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afeb642 commit b06f5e1Copy full SHA for b06f5e1
MetadataProcessor.Shared/Tables/nanoStringTable.cs
@@ -99,6 +99,13 @@ public ushort GetOrCreateStringId(
99
id = _lastAvailableId;
100
_idsByStrings.Add(value, id);
101
var length = Encoding.UTF8.GetBytes(value).Length + 1;
102
+
103
+ // sanity check for ID overflow
104
+ if (_lastAvailableId + length > ushort.MaxValue)
105
+ {
106
+ throw new InvalidOperationException($"String table overflow in assembly '{_context.AssemblyDefinition.Name}'. Can't use so many strings.");
107
+ }
108
109
_lastAvailableId += (ushort)(length);
110
}
111
return id;
0 commit comments