aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColm Donelan <colm.donelan@arm.com>2023-06-25 15:29:08 +0100
committerColm Donelan <colm.donelan@arm.com>2023-06-26 16:04:03 +0000
commited928a91a80db4f013995a558433012b1dfc03ea (patch)
treed221d9fbe34f416816d64f90808df35369df1c45 /tests
parent689ba0cd7d76788b546c4f635a5f95bd640259aa (diff)
downloadarmnn-ed928a91a80db4f013995a558433012b1dfc03ea.tar.gz
Fixing fault in ExeNet when a model file does not include an extension.
If you pass a file name without an extension as the -m parameter to execute network it won't be able to determine the parser to use. This results in a segmentation fault. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I91821a5abd50b65b8d60409aa9a807013e0b0e6a
Diffstat (limited to 'tests')
-rw-r--r--tests/ExecuteNetwork/ArmNNExecutor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ExecuteNetwork/ArmNNExecutor.cpp b/tests/ExecuteNetwork/ArmNNExecutor.cpp
index ac857a90df..6955a492b3 100644
--- a/tests/ExecuteNetwork/ArmNNExecutor.cpp
+++ b/tests/ExecuteNetwork/ArmNNExecutor.cpp
@@ -612,7 +612,10 @@ std::unique_ptr<ArmNNExecutor::IParser> ArmNNExecutor::CreateParser()
LogAndThrow("Not built with Onnx parser support.");
#endif
}
-
+ if (parser == nullptr)
+ {
+ throw InvalidArgumentException("Unable to determine the model type based on the file name extension.");
+ }
return parser;
}