linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] do not use expr->left for conditionals
@ 2020-04-10 18:56 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2020-04-10 18:56 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-10 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-10 18:56 [PATCH] do not use expr->left for conditionals Luc Van Oostenryck

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).