From c07a81e3a0d7b27358f10be9c09e16ecd5b17fe1 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 10 Dec 2024 18:13:09 -0800 Subject: [PATCH] Revert "[browser] fix code gen overflow (#110539)" This reverts commit 1fa2361dced0acec1a204e559bbb5677f863eeb7. --- .../gen/JSImportGenerator/JSSignatureContext.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs index f59bb25bca0f5..3f058a5c7eeb4 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs @@ -48,7 +48,6 @@ 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) @@ -58,8 +57,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);