Skip to content

Commit f20d0f3

Browse files
committed
Fixing the mono interp to assign locals as gint32
1 parent 1e61a40 commit f20d0f3

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

src/mono/mono/mini/interp/interp.c

+24-8
Original file line numberDiff line numberDiff line change
@@ -6227,15 +6227,19 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
62276227
}
62286228
MINT_IN_CASE(MINT_CONV_OVF_I2_R4) {
62296229
float val = LOCAL_VAR (ip [2], float);
6230-
if (!mono_try_trunc_i2 (val, (gint16*)(locals + ip [1])))
6230+
gint16 res;
6231+
if (!mono_try_trunc_i2 (val, &res))
62316232
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6233+
LOCAL_VAR (ip [1], gint32) = res;
62326234
ip += 3;
62336235
MINT_IN_BREAK;
62346236
}
62356237
MINT_IN_CASE(MINT_CONV_OVF_I2_R8) {
62366238
double val = LOCAL_VAR (ip [2], double);
6237-
if (!mono_try_trunc_i2 (val, (gint16*)(locals + ip [1])))
6239+
gint16 res;
6240+
if (!mono_try_trunc_i2 (val, &res))
62386241
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6242+
LOCAL_VAR (ip [1], gint32) = res;
62396243
ip += 3;
62406244
MINT_IN_BREAK;
62416245
}
@@ -6257,15 +6261,19 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
62576261
}
62586262
MINT_IN_CASE(MINT_CONV_OVF_U2_R4) {
62596263
float val = LOCAL_VAR (ip [2], float);
6260-
if (!mono_try_trunc_u2 (val, (guint16*)(locals + ip [1])))
6264+
guint16 res;
6265+
if (!mono_try_trunc_u2 (val, &res))
62616266
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6267+
LOCAL_VAR (ip [1], gint32) = res;
62626268
ip += 3;
62636269
MINT_IN_BREAK;
62646270
}
62656271
MINT_IN_CASE(MINT_CONV_OVF_U2_R8) {
62666272
double val = LOCAL_VAR (ip [2], double);
6267-
if (!mono_try_trunc_u2 (val, (guint16*)(locals + ip [1])))
6273+
guint16 res;
6274+
if (!mono_try_trunc_u2 (val, &res))
62686275
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6276+
LOCAL_VAR (ip [1], gint32) = res;
62696277
ip += 3;
62706278
MINT_IN_BREAK;
62716279
}
@@ -6303,15 +6311,19 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
63036311
}
63046312
MINT_IN_CASE(MINT_CONV_OVF_I1_R4) {
63056313
float val = LOCAL_VAR (ip [2], float);
6306-
if (!mono_try_trunc_i1 (val, (gint8*)(locals + ip [1])))
6314+
gint8 res;
6315+
if (!mono_try_trunc_i1 (val, &res))
63076316
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6317+
LOCAL_VAR (ip [1], gint32) = res;
63086318
ip += 3;
63096319
MINT_IN_BREAK;
63106320
}
63116321
MINT_IN_CASE(MINT_CONV_OVF_I1_R8) {
63126322
double val = LOCAL_VAR (ip [2], double);
6313-
if (!mono_try_trunc_i1 (val, (gint8*)(locals + ip [1])))
6323+
gint8 res;
6324+
if (!mono_try_trunc_i1 (val, &res))
63146325
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6326+
LOCAL_VAR (ip [1], gint32) = res;
63156327
ip += 3;
63166328
MINT_IN_BREAK;
63176329
}
@@ -6333,15 +6345,19 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
63336345
}
63346346
MINT_IN_CASE(MINT_CONV_OVF_U1_R4) {
63356347
float val = LOCAL_VAR (ip [2], float);
6336-
if (!mono_try_trunc_u1 (val, (guint8*)(locals + ip [1])))
6348+
guint8 res;
6349+
if (!mono_try_trunc_u1 (val, &res))
63376350
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6351+
LOCAL_VAR (ip [1], gint32) = res;
63386352
ip += 3;
63396353
MINT_IN_BREAK;
63406354
}
63416355
MINT_IN_CASE(MINT_CONV_OVF_U1_R8) {
63426356
double val = LOCAL_VAR (ip [2], double);
6343-
if (!mono_try_trunc_u1 (val, (guint8*)(locals + ip [1])))
6357+
guint8 res;
6358+
if (!mono_try_trunc_u1 (val, &res))
63446359
THROW_EX (interp_get_exception_overflow (frame, ip), ip);
6360+
LOCAL_VAR (ip [1], gint32) = res;
63456361
ip += 3;
63466362
MINT_IN_BREAK;
63476363
}

0 commit comments

Comments
 (0)