Blame SOURCES/rhbz1643997.0010-bpf-translate.cxx-plug-an-exception-gap-in-is_numeri.patch

e4e640
From baabce812704826c5f7b20ed4afcca816cab7967 Mon Sep 17 00:00:00 2001
e4e640
From: Serhei Makarov <smakarov@redhat.com>
e4e640
Date: Thu, 25 Oct 2018 12:19:53 -0400
e4e640
Subject: [PATCH 10/32] bpf-translate.cxx :: plug an exception gap in
e4e640
 is_numeric()
e4e640
e4e640
---
e4e640
 bpf-translate.cxx | 8 ++++++--
e4e640
 1 file changed, 6 insertions(+), 2 deletions(-)
e4e640
e4e640
diff --git a/bpf-translate.cxx b/bpf-translate.cxx
e4e640
index df22401ad..bf55c56b4 100644
e4e640
--- a/bpf-translate.cxx
e4e640
+++ b/bpf-translate.cxx
e4e640
@@ -681,11 +681,15 @@ is_numeric (const std::string &str)
e4e640
   size_t pos = 0;
e4e640
   try {
e4e640
     stol(str, &pos, 0);
e4e640
-  } catch (std::invalid_argument &e) {
e4e640
+  } catch (const std::invalid_argument &e) {
e4e640
     return false;
e4e640
-  } catch (std::out_of_range &e) {
e4e640
+  } catch (const std::out_of_range &e) {
e4e640
     /* XXX: probably numeric but not valid; give up */
e4e640
     return false;
e4e640
+  } catch (...) {
e4e640
+    /* XXX: handle other errors the same way */
e4e640
+    std::cerr << "BUG: bpf assembler -- is_numeric() saw unexpected exception" << std::endl;
e4e640
+    return false;
e4e640
   }
e4e640
   return (pos == str.size());
e4e640
 }
e4e640
-- 
e4e640
2.14.5
e4e640