This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -6830,7 +6830,7 @@ var_types Compiler::impImportCall(OPCODE opcode,
6830
6830
//-------------------------------------------------------------------------
6831
6831
// The "this" pointer
6832
6832
6833
- if (!(mflags & CORINFO_FLG_STATIC) || opcode == CEE_NEWOBJ)
6833
+ if (!(mflags & CORINFO_FLG_STATIC) && !(( opcode == CEE_NEWOBJ) && (newobjThis == nullptr)) )
6834
6834
{
6835
6835
GenTreePtr obj;
6836
6836
@@ -11736,10 +11736,18 @@ MATH_MAYBE_CALL_NO_OVF: ovfl = false;
11736
11736
// At present this can only be String
11737
11737
else if (clsFlags & CORINFO_FLG_VAROBJSIZE)
11738
11738
{
11739
- // This is the case for variable-sized objects that are not
11740
- // arrays. In this case, call the constructor with a null 'this'
11741
- // pointer
11742
- newObjThisPtr = gtNewIconNode(0, TYP_REF);
11739
+ if (eeGetEEInfo()->targetAbi == CORINFO_CORERT_ABI)
11740
+ {
11741
+ // The dummy argument does not exist in CoreRT
11742
+ newObjThisPtr = nullptr;
11743
+ }
11744
+ else
11745
+ {
11746
+ // This is the case for variable-sized objects that are not
11747
+ // arrays. In this case, call the constructor with a null 'this'
11748
+ // pointer
11749
+ newObjThisPtr = gtNewIconNode(0, TYP_REF);
11750
+ }
11743
11751
11744
11752
/* Remember that this basic block contains 'new' of an object */
11745
11753
block->bbFlags |= BBF_HAS_NEWOBJ;
You can’t perform that action at this time.
0 commit comments