ref: 33d48f1302e23a91f0835080c8b00372051026c4
parent: a300bb7984c6d77b298981e1c6d6be00b4ab56b3
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Jan 26 07:46:06 EST 2016
[cc1] Remove call to strlen() in initialize() The result of this call can be obtained from the own type, and in some cases ("foo\0") the call to strlen can give incorrect values.
--- a/cc1/init.c
+++ b/cc1/init.c
@@ -120,7 +120,7 @@
errorp("array of inappropriate type initialized from string constant");
goto return_zero;
}
- len = strlen(sym->u.s);
+ len = sym->type->n.elem;
if (!tp->defined) {
tp->defined = 1;
tp->n.elem = len+1;