Skip to content
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/libpaje/PajeEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class PajeEntity : public PajeVirtualEntity

public:
PajeEntity (PajeContainer *container, PajeType *type, PajeTraceEvent *event);
~PajeEntity (void);
// Add virtual destructor to prevent undefined behavior when deleting derived objects via base pointer
virtual ~PajeEntity (void);
void addPajeTraceEvent (PajeTraceEvent *event);
PajeContainer *container (void) const;
PajeType *type (void) const;
Expand Down
4 changes: 3 additions & 1 deletion src/libpaje/PajeSimulator+Queries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ std::vector<PajeValue*> PajeSimulator::valuesForEntityType (PajeType *type)
PajeCategorizedType *catType = dynamic_cast<PajeCategorizedType*>(type);
if (catType){
std::pair<std::string,PajeValue*> val;
for (auto it = catType->values().begin(); it != catType->values().end(); ++it)
// Store the returned container to avoid dangling iterators from temporary
auto vals = catType->values();
for (auto it = vals.begin(); it != vals.end(); ++it)
ret.push_back((std::pair<std::string, PajeValue*>(*it)).second);
}
return ret;
Expand Down
7 changes: 6 additions & 1 deletion src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ INCLUDE_DIRECTORIES (pj_equals ${PROJECT_SOURCE_DIR}/src/libpaje/)
INCLUDE_DIRECTORIES(${pajeng_SOURCE_DIR}/src/fb/)
include_directories(${CMAKE_BINARY_DIR})
# FIXME check for libgomp / OpenMP support
set_target_properties(pj_equals PROPERTIES COMPILE_FLAGS "-fopenmp")
IF(APPLE)
set_target_properties(pj_equals PROPERTIES COMPILE_FLAGS "-Xpreprocessor -fopenmp")
TARGET_LINK_LIBRARIES(pj_equals omp)
ELSE()
set_target_properties(pj_equals PROPERTIES COMPILE_FLAGS "-fopenmp")
ENDIF()

IF(STATIC_LINKING)
TARGET_LINK_LIBRARIES(pj_equals paje_library_static)
Expand Down