From 09ff7cdbdfa55b375bf0b3f9c9e7491e8f2c875e Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Wed, 6 Mar 2024 11:40:20 +0200 Subject: [PATCH] [mono][interp] Add explicit cast for clarity --- src/mono/mono/mini/interp/interp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 8214a0e2909cf..61521990f1e8a 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -5286,7 +5286,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += 4; MINT_IN_BREAK; MINT_IN_CASE(MINT_ADD_I4_IMM2) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + READ32 (ip + 3); + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) + (gint32)READ32 (ip + 3); ip += 5; MINT_IN_BREAK; MINT_IN_CASE(MINT_ADD1_I8) @@ -5298,7 +5298,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += 4; MINT_IN_BREAK; MINT_IN_CASE(MINT_ADD_I8_IMM2) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + READ32 (ip + 3); + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) + (gint32)READ32 (ip + 3); ip += 5; MINT_IN_BREAK; MINT_IN_CASE(MINT_SUB_I4) @@ -5332,7 +5332,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += 4; MINT_IN_BREAK; MINT_IN_CASE(MINT_MUL_I4_IMM2) - LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) * READ32 (ip + 3); + LOCAL_VAR (ip [1], gint32) = LOCAL_VAR (ip [2], gint32) * (gint32)READ32 (ip + 3); ip += 5; MINT_IN_BREAK; MINT_IN_CASE(MINT_MUL_I8_IMM) @@ -5340,7 +5340,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += 4; MINT_IN_BREAK; MINT_IN_CASE(MINT_MUL_I8_IMM2) - LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) * READ32 (ip + 3); + LOCAL_VAR (ip [1], gint64) = LOCAL_VAR (ip [2], gint64) * (gint32)READ32 (ip + 3); ip += 5; MINT_IN_BREAK; MINT_IN_CASE(MINT_ADD_MUL_I4_IMM)