From ae7c978e56b5ef1fea2dcf84b5a50d04b9b5aecf Mon Sep 17 00:00:00 2001 From: Adam Perlin Date: Mon, 27 Jul 2026 14:53:35 -0700 Subject: [PATCH] Normalize TYP_BYREF to TYP_INT in implicit casts even on x86 --- src/coreclr/jit/importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 90396e6a294bc5..94e74e96019ac5 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -2427,12 +2427,12 @@ GenTree* Compiler::impImplicitIorI4Cast(GenTree* tree, var_types dstTyp, bool ze // Note that this allows TYP_INT to be cast to a TYP_I_IMPL when wantedType is a TYP_BYREF or TYP_REF tree = gtNewCastNode(TYP_I_IMPL, tree, zeroExtend, TYP_I_IMPL); } +#endif // TARGET_64BIT else if ((wantedType == TYP_INT) && varTypeIsI(currType)) { // Note that this allows TYP_BYREF or TYP_REF to be cast to a TYP_INT tree = gtNewCastNode(TYP_INT, tree, false, TYP_INT); } -#endif // TARGET_64BIT } return tree;