diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-16 23:54:38 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-28 23:28:25 +0100 |
commit | 502199039614436d5cf7955ed689653eca27f747 (patch) | |
tree | c428f9d2006fb4b387b6f270c888efe19b34e872 /evaluate.c | |
parent | 9b2efc158c5c9700ffe355c59356879df7c9cc12 (diff) | |
download | sparse-502199039614436d5cf7955ed689653eca27f747.tar.gz |
remove redundant degenerate() in compatible_assignment_types()
In compatible_assignment_types(), the source expression is
first degenerated before calling check_assignment_types().
But this is not needed since check_assignment_types() must
anyway do the call to degenerate().
So, remove the redundant call to degenerate().
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'evaluate.c')
-rw-r--r-- | evaluate.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1501,9 +1501,9 @@ static int compatible_assignment_types(struct expression *expr, struct symbol *t struct expression **rp, const char *where) { const char *typediff; - struct symbol *source = degenerate(*rp); if (!check_assignment_types(target, rp, &typediff)) { + struct symbol *source = *rp ? (*rp)->ctype : NULL; warning(expr->pos, "incorrect type in %s (%s)", where, typediff); info(expr->pos, " expected %s", show_typename(target)); info(expr->pos, " got %s", show_typename(source)); |