[PATCH] remove redundant degenerate() in compatible_assignment_types()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/evaluate.c b/evaluate.c
index 19bdab920..34578be8a 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -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));
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux