/* strcpy returns the initial param. */
cd.maybe_set_lhs (dest_sval);
- const svalue *bytes_to_copy;
+ const svalue *bytes_to_copy = nullptr;
if (const svalue *num_bytes_read_sval
= cd.check_for_null_terminated_string_arg (1, true, &bytes_to_copy))
{
+ gcc_assert (bytes_to_copy);
cd.complain_about_overlap (0, 1, num_bytes_read_sval);
model->write_bytes (dest_reg, num_bytes_read_sval, bytes_to_copy, ctxt);
}
reg->dump_to_pp (pp, true);
logger->end_log_line ();
}
+ if (out_sval)
+ *out_sval = nullptr;
const svalue *sval = scan_for_null_terminator_1 (reg, expr, out_sval, ctxt);
+ if (sval && out_sval)
+ gcc_assert (*out_sval);
if (logger)
{
pretty_printer *pp = logger->get_printer ();
out_sval,
&my_ctxt))
{
+ if (out_sval)
+ gcc_assert (*out_sval);
if (include_terminator)
return num_bytes_read_sval;
else
--- /dev/null
+/* { dg-additional-options "-O -fdump-analyzer -frounding-math" } */
+
+void *p;
+
+static inline void
+bar(_Complex float f)
+{
+ __builtin_strcpy(p, (void *)&f); /* { dg-warning "uninit" } */
+}
+
+void
+foo()
+{
+ bar(72057594037927934);
+}
--- /dev/null
+/* { dg-additional-options "-O -fdump-analyzer -frounding-math" } */
+
+void *p;
+
+static inline void
+bar(_Complex float f)
+{
+ __builtin_strcpy(p, (void *)&f);
+}
+
+void
+foo()
+{
+ bar(0);
+}