From 05cc90cece59a0b844fbb79b157fa148b0f0a24a Mon Sep 17 00:00:00 2001 From: gereon Date: Mon, 25 Feb 2013 14:59:45 +0100 Subject: [PATCH] Now also creating a std::set before inserting stuff... --- src/ir/Module.cpp | 3 +++ src/ir/Program.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/ir/Module.cpp b/src/ir/Module.cpp index c09351037..9a2337f8a 100644 --- a/src/ir/Module.cpp +++ b/src/ir/Module.cpp @@ -34,6 +34,9 @@ Module::Module(std::string moduleName, std::vector b for (unsigned int id = 0; id < this->commands.size(); id++) { std::string action = this->commands[id].getActionName(); if (action != "") { + if (this->actionsToCommandIndexMap.count(action) == 0) { + this->actionsToCommandIndexMap[action] = std::shared_ptr>(new std::set()); + } this->actionsToCommandIndexMap[action]->insert(id); this->actions.insert(action); } diff --git a/src/ir/Program.cpp b/src/ir/Program.cpp index 5ce464fda..7a11f31d2 100644 --- a/src/ir/Program.cpp +++ b/src/ir/Program.cpp @@ -24,6 +24,9 @@ Program::Program(ModelType modelType, std::mapmodules.size(); id++) { for (auto action : this->modules[id].getActions()) { + if (this->actionsToModuleIndexMap.count(action) == 0) { + this->actionsToModuleIndexMap[action] = std::shared_ptr>(new std::set()); + } this->actionsToModuleIndexMap[action]->insert(id); this->actions.insert(action); }