diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-01-20 00:30:53 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-02-28 21:08:22 +0100 |
commit | 53179dd438d65fdd8297f485ffa64fb28b6cab8e (patch) | |
tree | 7b6c73433176576b7b48ff8249cee6c049711e67 | |
parent | 7f1ea3b67e7f77f8f87340eefd71c79fe2b37614 (diff) | |
download | sparse-53179dd438d65fdd8297f485ffa64fb28b6cab8e.tar.gz |
remove confusing intermediate 'where' in evaluate_assignment()
In evaluate_assignment(), a local variable (named 'where') contains
the input expression (named 'expr', like in most other functions).
This is doubly confusing because:
*) both variables hold the same pointer.
*) the name 'where' is normally used for a string with extra
information for error messages.
So, remove this intermediate var and use the original 'expr' instead.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | evaluate.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1581,7 +1581,6 @@ static void evaluate_assign_to(struct expression *left, struct symbol *type) static struct symbol *evaluate_assignment(struct expression *expr) { struct expression *left = expr->left; - struct expression *where = expr; struct symbol *ltype; if (!lvalue_expression(left)) { @@ -1595,7 +1594,7 @@ static struct symbol *evaluate_assignment(struct expression *expr) if (!evaluate_assign_op(expr)) return NULL; } else { - if (!compatible_assignment_types(where, ltype, &expr->right, "assignment")) + if (!compatible_assignment_types(expr, ltype, &expr->right, "assignment")) return NULL; } |