Skip to content

Commit c616275

Browse files
author
Joe Valenzuela
committed
Alternate function to set valuetypes for ref-ness
Same method that ldloc.s uses, which incorporates the byref test.
1 parent 79abb43 commit c616275

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mono/mini/method-to-ir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12458,7 +12458,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
1245812458
CHECK_OPSIZE (4);
1245912459
n = read16 (ip + 2);
1246012460
CHECK_LOCAL (n);
12461-
if ((ip [4] == CEE_LDFLD) && ip_in_bb (cfg, cfg->cbb, ip + 4) && header->locals [n]->type == MONO_TYPE_VALUETYPE && !header->locals [n]->byref) {
12461+
if ((ip [4] == CEE_LDFLD) && ip_in_bb (cfg, cfg->cbb, ip + 4) && MONO_TYPE_ISSTRUCT (header->locals [n])) {
1246212462
/* Avoid loading a struct just to load one of its fields */
1246312463
EMIT_NEW_LOCLOADA (cfg, ins, n);
1246412464
} else {

0 commit comments

Comments
 (0)