diff options
author | Jeremy Koritzinsky <jekoritz@microsoft.com> | 2019-05-30 20:40:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 20:40:51 -0700 |
commit | 996c6ad8015ac8597c504df53aefebd58fad7395 (patch) | |
tree | a530416a225540c7402dcc6dfc520268e0bf7f56 | |
parent | c6d6fc20a597b01ad0e2745b6933ca216746e7df (diff) | |
download | coreclr-996c6ad8015ac8597c504df53aefebd58fad7395.tar.gz coreclr-996c6ad8015ac8597c504df53aefebd58fad7395.tar.bz2 coreclr-996c6ad8015ac8597c504df53aefebd58fad7395.zip |
Check that we are using a valid IDispatch invocation flag earlier to limit the amount of work we do when we're going to return early anyway. (#24872)
-rw-r--r-- | src/vm/dispatchinfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vm/dispatchinfo.cpp b/src/vm/dispatchinfo.cpp index c59e2c233f..6797a915a4 100644 --- a/src/vm/dispatchinfo.cpp +++ b/src/vm/dispatchinfo.cpp @@ -2096,6 +2096,11 @@ HRESULT DispatchInfo::InvokeMember(SimpleComCallWrapper *pSimpleWrap, DISPID id, if (wFlags & DISPATCH_CONSTRUCT) return E_INVALIDARG; + if ((!(wFlags & (DISPATCH_METHOD | DISPATCH_PROPERTYGET))) && pDispMemberInfo->GetMemberType() == EnumMemberTypes::Method) + { + return DISP_E_MEMBERNOTFOUND; + } + // We have the member so retrieve the number of formal parameters. NumParams = pDispMemberInfo->GetNumParameters(); |