linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
	Luc Van Oostenryck <luc.vanoostenryck@looxix.net>
Subject: [PATCH] OP_SWITCH should use 'insn->cond' instead of 'insn->target'
Date: Tue, 22 Nov 2016 17:32:33 +0100	[thread overview]
Message-ID: <20161122163233.3765-1-luc.vanoostenryck@gmail.com> (raw)

From: Luc Van Oostenryck <luc.vanoostenryck@looxix.net>

show_instruction() uses the field 'target' to display OP_SWITCH
instruction instead of 'cond' like OP_BR does.
It doesn't change anything since these two fields use the same
storage inside struct instruction but better to use the right field
to keep consistent.
---
 linearize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linearize.c b/linearize.c
index c6ada1e8..31d2a6cd 100644
--- a/linearize.c
+++ b/linearize.c
@@ -357,7 +357,7 @@ const char *show_instruction(struct instruction *insn)
 	}
 	case OP_SWITCH: {
 		struct multijmp *jmp;
-		buf += sprintf(buf, "%s", show_pseudo(insn->target));
+		buf += sprintf(buf, "%s", show_pseudo(insn->cond));
 		FOR_EACH_PTR(insn->multijmp_list, jmp) {
 			if (jmp->begin == jmp->end)
 				buf += sprintf(buf, ", %d -> .L%p", jmp->begin, jmp->target);
-- 
2.10.2


             reply	other threads:[~2016-11-22 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 16:32 Luc Van Oostenryck [this message]
2016-11-23  1:16 ` [PATCH] OP_SWITCH should use 'insn->cond' instead of 'insn->target' Christopher Li
2017-02-06 20:33 ` Luc Van Oostenryck
2017-02-06 23:16   ` Christopher Li

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=20161122163233.3765-1-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@looxix.net \
    --cc=sparse@chrisli.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 NNTP newsgroup(s).