diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-05-18 07:27:20 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-05-18 07:27:20 -0700 |
commit | 26e6f083354341fe0d41fd28e5dc7691efe86663 (patch) | |
tree | a3b7fcd83b526b5f2504174469fb067e4bab567a | |
parent | 90198e49936fac468ff42e1dd0a6d96ea666903c (diff) | |
download | coreclr-26e6f083354341fe0d41fd28e5dc7691efe86663.tar.gz coreclr-26e6f083354341fe0d41fd28e5dc7691efe86663.tar.bz2 coreclr-26e6f083354341fe0d41fd28e5dc7691efe86663.zip |
Handle NULL explicitly in VirtualCallStubManager::getStubKind
[tfs-changeset: 1472593]
-rw-r--r-- | src/vm/virtualcallstub.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vm/virtualcallstub.h b/src/vm/virtualcallstub.h index f5bf0d9506..02605f237d 100644 --- a/src/vm/virtualcallstub.h +++ b/src/vm/virtualcallstub.h @@ -325,6 +325,11 @@ public: WRAPPER_NO_CONTRACT; SUPPORTS_DAC; + // This method can called with stubStartAddress==NULL, e.g. when handling null reference exceptions + // caused by IP=0. Early out for this case to avoid confusing handled access violations inside predictStubKind. + if (PCODEToPINSTR(stubStartAddress) == NULL) + return SK_UNKNOWN; + // Rather than calling IsInRange(stubStartAddress) for each possible stub kind // we can peek at the assembly code and predict which kind of a stub we have StubKind predictedKind = predictStubKind(stubStartAddress); |