public static Foo* pFoo;
}
- [Category ("!INTERPRETER")]
/* MS.NET doesn't seem to throw in this case */
public unsafe static int test_0_ldflda_null_pointer () {
int* pi = &Foo.pFoo->i;
sp->data.p = mono_get_exception_null_reference ();
THROW_EX ((MonoException *)sp->data.p, ip);
MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLDA_UNSAFE)
+ o = sp [-1].data.p;
+ sp[-1].data.p = (char *)o + * (guint16 *)(ip + 1);
+ ip += 2;
+ MINT_IN_BREAK;
MINT_IN_CASE(MINT_LDFLDA)
o = sp [-1].data.p;
if (!o)
OPDEF(MINT_LDRMFLD_VT, "ldrmfld.vt", 4, MintOpShortAndInt)
OPDEF(MINT_LDFLDA, "ldflda", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLDA_UNSAFE, "ldflda.unsafe", 2, MintOpUShortInt)
OPDEF(MINT_STFLD_I1, "stfld.i1", 2, MintOpUShortInt)
OPDEF(MINT_STFLD_U1, "stfld.u1", 2, MintOpUShortInt)
ADD_CODE (&td, MINT_LDSFLDA);
ADD_CODE (&td, get_data_item_index (&td, field));
} else {
- ADD_CODE (&td, MINT_LDFLDA);
+ if ((td.sp - 1)->type == STACK_TYPE_O) {
+ ADD_CODE (&td, MINT_LDFLDA);
+ } else {
+ g_assert ((td.sp -1)->type == STACK_TYPE_MP);
+ ADD_CODE (&td, MINT_LDFLDA_UNSAFE);
+ }
ADD_CODE (&td, klass->valuetype ? field->offset - sizeof (MonoObject) : field->offset);
}
td.ip += 5;