Blame SOURCES/rhbz1643997.0032-PR23875-bpf_unparser-visit_foreach_loop-temporarily-.patch

e4e640
From 6fd1813950d708c5b94ed155213a7b9c84b7fbfc Mon Sep 17 00:00:00 2001
e4e640
From: Serhei Makarov <smakarov@redhat.com>
e4e640
Date: Tue, 13 Nov 2018 13:13:14 -0500
e4e640
Subject: [PATCH 32/32] PR23875 bpf_unparser::visit_foreach_loop(): temporarily
e4e640
 disable string key iteration
e4e640
e4e640
---
e4e640
 bpf-translate.cxx | 4 ++++
e4e640
 1 file changed, 4 insertions(+)
e4e640
e4e640
diff --git a/bpf-translate.cxx b/bpf-translate.cxx
e4e640
index 20cd47032..0f35e0d3f 100644
e4e640
--- a/bpf-translate.cxx
e4e640
+++ b/bpf-translate.cxx
e4e640
@@ -1532,6 +1532,10 @@ bpf_unparser::visit_foreach_loop(foreach_loop* s)
e4e640
     throw SEMANTIC_ERROR(_("unknown type"), s->base->tok);
e4e640
   vardecl *arraydecl = a->referent;
e4e640
 
e4e640
+  // TODO PR23875: foreach should handle string keys
e4e640
+  if (arraydecl->index_types[0] != pe_long)
e4e640
+    throw SEMANTIC_ERROR(_("unhandled string index type"), s->tok);
e4e640
+
e4e640
   auto g = glob.globals.find(arraydecl);
e4e640
   if (g == glob.globals.end())
e4e640
     throw SEMANTIC_ERROR(_("unknown array"), arraydecl->tok);
e4e640
-- 
e4e640
2.14.5
e4e640