nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

perlcc issues with format string ~~ (repeat line) with -O3 #277

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
perlcc -O3 -e 'format OUT =
bar ~~
.
open(OUT, ">foo") or die;
write(OUT); close OUT;
'; ./a.out
zsh: segmentation fault  ./a.out

other optimization levels don't segfault.

Original issue reported on code.google.com by todd.e.rinaldo on 23 Jan 2014 at 11:43

GoogleCodeExporter commented 9 years ago

Original comment by todd.e.rinaldo on 24 Jan 2014 at 1:34

GoogleCodeExporter commented 9 years ago

Original comment by todd.e.rinaldo on 24 Jan 2014 at 1:35

GoogleCodeExporter commented 9 years ago
format strings with ~ may not be static:

doparseform:
           case '~':
               if (*s == '~') {
                    repeat = TRUE;
                    *s = ' ';
                }

Original comment by reini.urban on 28 Jan 2014 at 9:29

GoogleCodeExporter commented 9 years ago
Fixed with ommit 6b72bca0d3967f32bb06c014cb0f3c8ff738b608
Author: Reini Urban <rurban@cpanel.net>
Date:   Tue Jan 28 14:46:47 2014 -0700

    1.43_01: fix #277 non-static formatstrings with ~~

    special case formline const strings. TODO: only with ~ in the string

Original comment by reini.urban on 28 Jan 2014 at 9:47

GoogleCodeExporter commented 9 years ago
Thanks works.

Original comment by todd.e.rinaldo on 30 Jan 2014 at 10:00