8173151: Code heap corruption due to incorrect inclusion test

Change inclusion test to use CodeBlob::code_begin() for AOT methods and start of CodeBlob otherwise. Added regression test.

Reviewed-by: thartmann, dlong, kvn
This commit is contained in:
Zoltan Majo 2017-02-10 08:16:49 +01:00
parent 7b93ee904b
commit ecee7fc84b
7 changed files with 113 additions and 6 deletions

View file

@ -240,6 +240,11 @@ public:
assert(result == CodeHeap::contains(p), "");
return result;
}
bool contains_blob(const CodeBlob* blob) const {
return CodeHeap::contains(blob->code_begin());
}
AOTCompiledMethod* find_aot(address p) const;
virtual void* find_start(void* p) const;