[Bug libfortran/86070] [7 regression] gfortran.dg/fmt_zero_digits.f90 segmentation fault starting with r261077
jvdelisle at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jun 10 00:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86070
--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #3)
> I am seeing a memory issue with valgrind....investigating
Had a variable being used unitialized specific to the flt_str_len that I added
in my offending patch and specific to the test case. The following fixes this
latent bug as shown with valgrind:
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;
rchar = '5';
Can you verify this fixes the originally reported problem which I could not
reproduce?
More information about the Gcc-bugs
mailing list