aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-01-30 23:07:08 -0500
committerJack Lloyd <[email protected]>2017-01-30 23:07:08 -0500
commit328491ce573582058a4ebdef74d687cbd1466c44 (patch)
tree7e51e2e54e2999aa6c649066b5e5d99db892f4f5
parent461dd2a2998a2ccf6ba49c52f821478fab5b0287 (diff)
Fix missing return in Windows path
-rw-r--r--src/lib/utils/os_utils.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp
index 1cf356666..fc401c3c1 100644
--- a/src/lib/utils/os_utils.cpp
+++ b/src/lib/utils/os_utils.cpp
@@ -345,10 +345,6 @@ void botan_sigill_handler(int)
int OS::run_cpu_instruction_probe(std::function<int ()> probe_fn)
{
- /*
- There doesn't seem to be any way for probe_result to not be initialized
- by some code path below, but this initializer is left as error just in case.
- */
int probe_result = -3;
#if defined(BOTAN_TARGET_OS_TYPE_IS_UNIX)
@@ -391,8 +387,6 @@ int OS::run_cpu_instruction_probe(std::function<int ()> probe_fn)
if(rc != 0)
throw Exception("run_cpu_instruction_probe sigaction restore failed");
- return probe_result;
-
#elif defined(BOTAN_TARGET_OS_IS_WINDOWS) && defined(BOTAN_TARGET_COMPILER_IS_MSVC)
// Windows SEH
@@ -400,7 +394,7 @@ int OS::run_cpu_instruction_probe(std::function<int ()> probe_fn)
{
try
{
- return probe_fn();
+ probe_result = probe_fn();
}
catch(...)
{
@@ -414,6 +408,8 @@ int OS::run_cpu_instruction_probe(std::function<int ()> probe_fn)
}
#endif
+
+ return probe_result;
}
}