commit 0cc93f139f379604bf0dd01eddfc072d443c9c32
Author:     Michael Forney <[email protected]>
AuthorDate: Fri Feb 17 22:06:07 2017 -0800
Commit:     Roberto E. Vargas Caballero <[email protected]>
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
@@ -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:

Reply via email to