diff options
author | Hanjoung Lee <hanjoung.lee@samsung.com> | 2020-06-24 19:05:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 19:05:43 +0900 |
commit | 221e04d28c633466598e7e2ba0bd74b0b53170f0 (patch) | |
tree | ffcd4780302b923005f0c3832ac06ec51b1500fa | |
parent | d004af03f0d124fa7da24eeac246ba2638bf6e5a (diff) | |
download | nnfw-221e04d28c633466598e7e2ba0bd74b0b53170f0.tar.gz nnfw-221e04d28c633466598e7e2ba0bd74b0b53170f0.tar.bz2 nnfw-221e04d28c633466598e7e2ba0bd74b0b53170f0.zip |
[nnpkgrun] coverity: Fix except thrown in noexcept (#2558)
Fix exceptions thrown in noexcept function. This commit makes it not
`noexcept` and put in a try block so the exceptions are handled.
ONE-DCO-1.0-Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
-rw-r--r-- | tests/tools/nnpackage_run/src/args.cc | 2 | ||||
-rw-r--r-- | tests/tools/nnpackage_run/src/args.h | 2 | ||||
-rw-r--r-- | tests/tools/nnpackage_run/src/nnpackage_run.cc | 20 |
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/tools/nnpackage_run/src/args.cc b/tests/tools/nnpackage_run/src/args.cc index 26446219d..577b258f6 100644 --- a/tests/tools/nnpackage_run/src/args.cc +++ b/tests/tools/nnpackage_run/src/args.cc @@ -97,7 +97,7 @@ void handleShapeParam(nnpkg_run::TensorShapeMap &shape_map, const std::string &s namespace nnpkg_run { -Args::Args(const int argc, char **argv) noexcept +Args::Args(const int argc, char **argv) { Initialize(); Parse(argc, argv); diff --git a/tests/tools/nnpackage_run/src/args.h b/tests/tools/nnpackage_run/src/args.h index 02f5f409e..41a5c505c 100644 --- a/tests/tools/nnpackage_run/src/args.h +++ b/tests/tools/nnpackage_run/src/args.h @@ -32,7 +32,7 @@ using TensorShapeMap = std::unordered_map<uint32_t, std::vector<int>>; class Args { public: - Args(const int argc, char **argv) noexcept; + Args(const int argc, char **argv); void print(void); const std::string &getPackageFilename(void) const { return _package_filename; } diff --git a/tests/tools/nnpackage_run/src/nnpackage_run.cc b/tests/tools/nnpackage_run/src/nnpackage_run.cc index 44664d533..3926c5784 100644 --- a/tests/tools/nnpackage_run/src/nnpackage_run.cc +++ b/tests/tools/nnpackage_run/src/nnpackage_run.cc @@ -75,19 +75,19 @@ NNFW_STATUS resolve_op_backend(nnfw_session *session) int main(const int argc, char **argv) { using namespace nnpkg_run; - Args args(argc, argv); - auto nnpackage_path = args.getPackageFilename(); - if (args.printVersion()) - { - uint32_t version; - NNPR_ENSURE_STATUS(nnfw_query_info_u32(NULL, NNFW_INFO_ID_VERSION, &version)); - std::cout << "nnpkg_run (nnfw runtime: v" << (version >> 24) << "." - << ((version & 0x0000FF00) >> 8) << "." << (version & 0xFF) << ")" << std::endl; - exit(0); - } try { + Args args(argc, argv); + auto nnpackage_path = args.getPackageFilename(); + if (args.printVersion()) + { + uint32_t version; + NNPR_ENSURE_STATUS(nnfw_query_info_u32(NULL, NNFW_INFO_ID_VERSION, &version)); + std::cout << "nnpkg_run (nnfw runtime: v" << (version >> 24) << "." + << ((version & 0x0000FF00) >> 8) << "." << (version & 0xFF) << ")" << std::endl; + exit(0); + } #ifdef RUY_PROFILER ruy::profiler::ScopeProfile ruy_profile; |