This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/17860] foreach loop fails -p4 if array slice is an expression
- From: "jlebon at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Mon, 19 Jan 2015 16:21:04 +0000
- Subject: [Bug translator/17860] foreach loop fails -p4 if array slice is an expression
- Auto-submitted: auto-generated
- References: <bug-17860-6586 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17860
--- Comment #1 from Jonathan Lebon <jlebon at redhat dot com> ---
The reason this fails is that the logic in c_tmpcounter::visit_foreach_loop()
is not exactly matched with c_unparser::visit_foreach_loop(). The order in
which tmpvars are declared is not the same as the order in which they are used
up during unparsing.
This doesn't cause an issue in the working case above since tmpcounter declares
and unparser uses 4 tmpvars in consecutive order. However, when i++ is used,
tmpcounter introduces two new vars for the post_crement, one of which it ends
up not declaring. When c_unparser then tries to use this same numbered tmpvar
we get the failures above.
Currently testing a patch for this.
--
You are receiving this mail because:
You are the assignee for the bug.