diff options
author | Xi Wang <xi.wang@gmail.com> | 2013-05-16 16:55:33 -0400 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-03 17:45:20 +0100 |
commit | 9a5a8639d8cbd3ca438a0f001830d9c95f2828bc (patch) | |
tree | 848336c28d7497f4b9548c677ddeb0d9a14a565c | |
parent | 57f861160762b498b4c90a68ee4863e12a9c899c (diff) | |
download | sparse-9a5a8639d8cbd3ca438a0f001830d9c95f2828bc.tar.gz |
fix pointer casts in evaluate_compare()
The results of cast_to() seem unused. Assign them to expr->left and
expr->right.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | evaluate.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1096,11 +1096,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; } } @@ -1116,11 +1116,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; } } |