* typeck2.c (digest_init_r): Fix overlength strings.
* vtable-class-hierarchy.c (build_key_buffer_arg): Make string literal
NUL terminated.
From-SVN: r264286
+2018-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * typeck2.c (digest_init_r): Fix overlength strings.
+ * vtable-class-hierarchy.c (build_key_buffer_arg): Make string literal
+ NUL terminated.
+
2018-09-13 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/87093
counted in the length of the constant, but in C++ this would
be invalid. */
if (size < TREE_STRING_LENGTH (init))
- permerror (loc, "initializer-string for array "
- "of chars is too long");
+ {
+ permerror (loc, "initializer-string for array "
+ "of chars is too long");
+
+ init = build_string (size, TREE_STRING_POINTER (init));
+ TREE_TYPE (init) = type;
+ }
}
return init;
}