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

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