aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2013-05-16 16:55:33 -0400
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-03 17:45:20 +0100
commit9a5a8639d8cbd3ca438a0f001830d9c95f2828bc (patch)
tree848336c28d7497f4b9548c677ddeb0d9a14a565c
parent57f861160762b498b4c90a68ee4863e12a9c899c (diff)
downloadsparse-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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/evaluate.c b/evaluate.c
index 74c7fd1d..7c3389cf 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -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;
}
}