From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] do not use expr->left for conditionals
Date: Fri, 10 Apr 2020 20:56:40 +0200 [thread overview]
Message-ID: <20200410185640.65301-1-luc.vanoostenryck@gmail.com> (raw)
expr->left & expr->conditional are unioned but 'left'
should only be used for binary operators.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
expression.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/expression.c b/expression.c
index ffb6cb9dc415..5b9bddfe456e 100644
--- a/expression.c
+++ b/expression.c
@@ -873,7 +873,7 @@ struct token *conditional_expression(struct token *token, struct expression **tr
if (*tree && match_op(token, '?')) {
struct expression *expr = alloc_expression(token->pos, EXPR_CONDITIONAL);
expr->op = token->special;
- expr->left = *tree;
+ expr->conditional = *tree;
*tree = expr;
token = parse_expression(token->next, &expr->cond_true);
token = expect(token, ':', "in conditional expression");
--
2.26.0
reply other threads:[~2020-04-10 18:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200410185640.65301-1-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.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).