-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the devirtualization issue with TR_RelocationRecord
When processing relocation records the JIT allocates a generic TR_RelocationRecord on the stack and then morphs this object into a specialized variety using placement new. The expectation is that any call off the newly created object is going to use the vtable to invoke the specific code associated with a specialized/derived relocation record. However, the C++ compiler is allowed to devirtualize calls and if that occurs, the JIT is going to invoke the implementation in the generic TR_RelocationRecord. The solution introduced by this commit is to use an object factory that builds a specific relocation record at a designated address and returns a pointer to that address. The newly created object must be accessed only through the pointer returned by the object factory. Signed-off-by: Marius Pirvu <[email protected]>
- Loading branch information
Showing
2 changed files
with
126 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.