Skip to content
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

Fix for "error: ‘dynamic_cast’ not permitted with -fno-rtti" #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef CORE_WRAPPER_HPP_
#define CORE_WRAPPER_HPP_


#include "pin.H"

#include <pthread.h>
Expand Down Expand Up @@ -366,7 +367,7 @@ class WrapperFactory {
WrapperMap::iterator it = wrappers_.find(name);
if (it == wrappers_.end())
return NULL;
return dynamic_cast<W *>(it->second);
return reinterpret_cast<W *>(it->second);
}

static WrapperFactory *GetInstance() {
Expand Down
8 changes: 4 additions & 4 deletions src/systematic/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,13 @@ Controller::BarrierInfo *Controller::GetBarrierInfo(address_t iaddr) {
Object *Controller::GetObject(address_t iaddr) {
Region *region = FindRegion(iaddr);
DEBUG_ASSERT(region);
SRegion *sregion = dynamic_cast<SRegion *>(region);
SRegion *sregion = reinterpret_cast<SRegion *>(region);
if (sregion) {
Image *image = sregion->image;
address_t offset = iaddr - sregion->addr;
return program_->GetSObject(image, offset);
}
DRegion *dregion = dynamic_cast<DRegion *>(region);
DRegion *dregion = reinterpret_cast<DRegion *>(region);
if (dregion) {
Thread *creator = dregion->creator;
Inst *creator_inst = dregion->creator_inst;
Expand Down Expand Up @@ -1033,7 +1033,7 @@ void Controller::FreeSRegion(address_t addr) {
// delete a static region
Region::Map::iterator it = region_table_.find(addr);
if (it != region_table_.end()) {
SRegion *region = dynamic_cast<SRegion *>(it->second);
SRegion *region = reinterpret_cast<SRegion *>(it->second);
DEBUG_ASSERT(region);
region_table_.erase(it);
FreeMutexInfo(region);
Expand All @@ -1046,7 +1046,7 @@ void Controller::FreeDRegion(address_t addr) {
// delete a dynamic region
Region::Map::iterator it = region_table_.find(addr);
if (it != region_table_.end()) {
DRegion *region = dynamic_cast<DRegion *>(it->second);
DRegion *region = reinterpret_cast<DRegion *>(it->second);
DEBUG_ASSERT(region);
region_table_.erase(it);
FreeMutexInfo(region);
Expand Down