public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "jlebon at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/17860] foreach loop fails -p4 if array slice is an expression
Date: Mon, 19 Jan 2015 16:21:00 -0000	[thread overview]
Message-ID: <bug-17860-6586-MHZYsiwD4O@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17860-6586@http.sourceware.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.

  reply	other threads:[~2015-01-19 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 16:18 [Bug translator/17860] New: " jlebon at redhat dot com
2015-01-19 16:21 ` jlebon at redhat dot com [this message]
2015-01-23 14:26 ` [Bug translator/17860] " jlebon at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-17860-6586-MHZYsiwD4O@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).