From 5d9c2442b9ed194544487012c619c0f5427c0b4a Mon Sep 17 00:00:00 2001 From: Abegail Jakop Date: Fri, 15 Aug 2014 16:42:48 -0400 Subject: [PATCH] PR12333: printscript() prints array slice in foreach loops --- parse.cxx | 1 + staptree.cxx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/parse.cxx b/parse.cxx index 61f897815..eb15525e4 100644 --- a/parse.cxx +++ b/parse.cxx @@ -2862,6 +2862,7 @@ parser::parse_foreach_loop () t = next(); symbol* sym = new symbol; sym->tok = t; + sym->name = t->content; expr = sym; } else diff --git a/staptree.cxx b/staptree.cxx index f44081dbf..396879dc6 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -1167,6 +1167,16 @@ void foreach_loop::print (ostream& o) const } o << "] in "; base->print (o); + if (!array_slice.empty()) + { + o << "["; + for (unsigned i=0; i 0) o << ", "; + array_slice[i]->print (o); + } + o << "]"; + } if (sort_direction != 0 && sort_column == 0) { switch (sort_aggr) -- 2.43.5