Skip to content

Commit

Permalink
src/ETISS.cpp: raise fatal error if plugin can not be found
Browse files Browse the repository at this point in the history
Before, etiss would just print a warning due to passing a nullptr to addPlugin:

```
=== Setting up plug-ins ===
ETISS: Info:   Adding Plugin QVanillaAcceleratorT2

ETISS: Warning: etiss::CPUCore::addPlugin() called without passing a valid plugin pointer.
        {
                {core0}
        }
```
  • Loading branch information
PhilippvK committed Aug 28, 2024
1 parent 9354877 commit acc1747
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ETISS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,10 @@ void etiss::Initializer::loadIniPlugins(std::shared_ptr<etiss::CPUCore> cpu)
continue;
}
etiss::log(etiss::INFO, " Adding Plugin " + *pluginName + "\n");
cpu->addPlugin(etiss::getPlugin(*pluginName, options));
std::shared_ptr<Plugin> plugin = etiss::getPlugin(*pluginName, options);
if (!plugin)
etiss::log(etiss::FATALERROR, "Plugin not found: " + *pluginName + "\n");
cpu->addPlugin(plugin);
}
}
if (!po_simpleIni)
Expand Down Expand Up @@ -658,7 +661,10 @@ void etiss::Initializer::loadIniPlugins(std::shared_ptr<etiss::CPUCore> cpu)
etiss::log(etiss::WARNING, "Multiple values for option. Took only last one!");
}
}
cpu->addPlugin(etiss::getPlugin(pluginName, options));
std::shared_ptr<Plugin> plugin = etiss::getPlugin(pluginName, options);
if (!plugin)
etiss::log(etiss::FATALERROR, "Plugin not found: " + pluginName + "\n");
cpu->addPlugin(plugin);
}
}

Expand Down

0 comments on commit acc1747

Please sign in to comment.