linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xi Wang <xi.wang@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: sparse@chrisli.org, Xi Wang <xi.wang@gmail.com>
Subject: [PATCH] fix pointer casts in evaluate_compare()
Date: Thu, 16 May 2013 16:55:33 -0400	[thread overview]
Message-ID: <1368737733-6475-1-git-send-email-xi.wang@gmail.com> (raw)

The results of cast_to() seem unused.  Assign them to expr->left and
expr->right.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
 evaluate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index 0dfa519..d9c767f 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1024,11 +1024,11 @@ static struct symbol *evaluate_compare(struct expression *expr)
 			goto OK;
 		}
 		if (is_null1 && (rclass & TYPE_PTR)) {
-			left = cast_to(left, rtype);
+			expr->left = cast_to(left, rtype);
 			goto OK;
 		}
 		if (is_null2 && (lclass & TYPE_PTR)) {
-			right = cast_to(right, ltype);
+			expr->right = cast_to(right, ltype);
 			goto OK;
 		}
 	}
@@ -1044,11 +1044,11 @@ static struct symbol *evaluate_compare(struct expression *expr)
 	if (expr->op == SPECIAL_EQUAL || expr->op == SPECIAL_NOTEQUAL) {
 		if (ltype->ctype.as == rtype->ctype.as) {
 			if (lbase == &void_ctype) {
-				right = cast_to(right, ltype);
+				expr->right = cast_to(right, ltype);
 				goto OK;
 			}
 			if (rbase == &void_ctype) {
-				left = cast_to(left, rtype);
+				expr->left = cast_to(left, rtype);
 				goto OK;
 			}
 		}
-- 
1.8.1.2


             reply	other threads:[~2013-05-16 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 20:55 Xi Wang [this message]
2013-05-19  7:48 ` [PATCH] fix pointer casts in evaluate_compare() Pekka Enberg
2013-05-19 12:29   ` Xi Wang

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=1368737733-6475-1-git-send-email-xi.wang@gmail.com \
    --to=xi.wang@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --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).