This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]