[hackers] [scc] [cc1] Don't fold OPTR OADDR if it would change the type || Michael Forney

From: <git_AT_suckless.org>
Date: Sat, 18 Feb 2017 07:11:54 +0100 (CET)

commit 0cc93f139f379604bf0dd01eddfc072d443c9c32
Author: Michael Forney <mforney_AT_mforney.org>
AuthorDate: Fri Feb 17 22:06:07 2017 -0800
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Feb 18 07:11:34 2017 +0100

    [cc1] Don't fold OPTR OADDR if it would change the type
    
    Fixes 0093-arrayinit.c and 0095-arrayselector.c.

diff --git a/cc1/fold.c b/cc1/fold.c
index 2cfa316..198e249 100644
--- a/cc1/fold.c
+++ b/cc1/fold.c
_AT_@ -400,7 +400,7 @@ foldunary(Node *np, Node *l)
                         return NULL;
                 break;
         case OPTR:
- if (op != OADDR)
+ if (op != OADDR || np->type != l->left->type)
                         return NULL;
                 break;
         case OADDR:
Received on Sat Feb 18 2017 - 07:11:54 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 18 2017 - 07:12:23 CET