- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
[clr-interp] Emit INTOP_NEWMDARR only for array ctor #116544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
d059290
              6d38dee
              93ea23c
              ffc84f7
              d1b7bce
              d23616b
              a05ebee
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|  | @@ -2506,17 +2506,14 @@ void InterpCompiler::EmitCall(CORINFO_RESOLVED_TOKEN* constrainedClass, bool rea | |||
| } | ||||
| m_pLastNewIns->data[0] = GetDataItemIndex(callInfo.hMethod); | ||||
| } | ||||
| else if ((callInfo.classFlags & CORINFO_FLG_ARRAY) && !readonly) | ||||
| else if ((callInfo.classFlags & CORINFO_FLG_ARRAY) && newObj) | ||||
| { | ||||
| CORINFO_SIG_INFO ctorSignature; | ||||
| CORINFO_CLASS_HANDLE ctorClass; | ||||
|  | ||||
| m_compHnd->getMethodSig(resolvedCallToken.hMethod, &ctorSignature); | ||||
| ctorClass = m_compHnd->getMethodClass(resolvedCallToken.hMethod); | ||||
| CORINFO_CLASS_HANDLE arrayClsHnd = m_compHnd->getMethodClass(resolvedCallToken.hMethod); | ||||
| uint32_t rank = m_compHnd->getArrayRank(arrayClsHnd); | ||||
|  | ||||
| AddIns(INTOP_NEWMDARR); | ||||
| m_pLastNewIns->data[0] = GetDataItemIndex(ctorClass); | ||||
| m_pLastNewIns->data[1] = numArgs; | ||||
| m_pLastNewIns->data[0] = GetDataItemIndex(arrayClsHnd); | ||||
| m_pLastNewIns->data[1] = rank; | ||||
|          | ||||
| static OBJECTREF CreateMultiDimArray(MethodTable* arrayClass, int8_t* stack, int32_t dimsOffset, int rank) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the actual number of the arguments in the signature, so that the code handles different overloads of array constructor correctly.
Sorry I overlooked this even though you mentioned it. I was focused on #116493 and I think the error was not properly guarding the INTOP_NEWMDARR case, which caused other instance methods to take the same path.
Uh oh!
There was an error while loading. Please reload this page.