> > 2016-07-11  Jerry DeLisle  <jvdeli...@gcc.gnu.org>
> > 
> >     PR fortran/66310
> >     * simplify.c (gfc_simplify_repeat): Set max repeat to huge - 1 to allow
> >     one byte for null terminating the resulting string constant.
>
> OK, thanks
Please hold on. I still see several problem with the patch applied. One is

   program p
      character :: z = 'z'
      print *, repeat(z, huge(1)-2**9)
   end

a.out(67209,0x7fff77e0b000) malloc: *** mach_vm_map(size=18446744071562067968) 
failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Operating system error: Cannot allocate memory
Memory allocation failure in realloc

on x86_64-apple-darwin15.5 with/without the patch. print *, repeat(z, 
huge(1)-2**9-1) "works".

I’ll try to report the other problems in the PR later today.

Dominique


Reply via email to