This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libgfortran] PR86070 - [7 regression] gfortran.dg/fmt_zero_digits.f90 segmentation fault
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 9 Jun 2018 18:48:12 -0700
- Subject: [patch, libgfortran] PR86070 - [7 regression] gfortran.dg/fmt_zero_digits.f90 segmentation fault
I have not confirmed this fixes the segfault reported, but valgrind
reports jump or move on uninitialized for the test case and this fixes
that part.
I will commit as obvious/simple on trunk and follow through on 7 and 8.
Regression tested on x86_64.
Regards,
Jerry
2018-06-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/86070
* io/write_float.def (build_float_string): Initialize *len.
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 177a568e041..25ea64beb21 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -135,6 +135,7 @@ build_float_string (st_parameter_dt *dtp, const
fnode *f, char *buffer,
w = f->u.real.w;
d = f->u.real.d;
p = dtp->u.p.scale_factor;
+ *len = 0;