Skip to content

Commit

Permalink
[browser] fix code gen overflow (dotnet#110539)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara authored Dec 10, 2024
1 parent f0e1d7b commit 1fa2361
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static JSSignatureContext Create(

// there could be multiple method signatures with the same name, get unique signature name
uint hash = 17;
int typesHash;
unchecked
{
foreach (var param in sigContext.ElementTypeInformation)
Expand All @@ -57,8 +58,8 @@ public static JSSignatureContext Create(
foreach (char c in param.ManagedType.FullTypeName)
hash = hash * 31 + c;
}
typesHash = (int)(hash & int.MaxValue);
};
int typesHash = Math.Abs((int)hash);

var fullName = $"{method.ContainingType.ToDisplayString()}.{method.Name}";
string qualifiedName = GetFullyQualifiedMethodName(env, method);
Expand Down

0 comments on commit 1fa2361

Please sign in to comment.