shithub: scc

Download patch

ref: bc58494b6814e9a55b69d8998dcb7fafabccc025
parent: fe5736a6732749de40131cc0ac3c363f948616da
author: Michael Forney <[email protected]>
date: Fri Feb 17 17:06:07 EST 2017

[cc1] Don't fold OPTR OADDR if it would change the type

Fixes 0093-arrayinit.c and 0095-arrayselector.c.

--- a/cc1/fold.c
+++ b/cc1/fold.c
@@ -400,7 +400,7 @@
 			return NULL;
 		break;
 	case OPTR:
-		if (op != OADDR)
+		if (op != OADDR || np->type != l->left->type)
 			return NULL;
 		break;
 	case OADDR: