From: Nicholas Clark Date: Tue, 13 Jul 2004 18:58:41 +0000 (+0000) Subject: Work around evil compiler bug on OS X. (Sucks all memory) X-Git-Tag: v5.10.0~7773 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/4edfc503949d80de79e38b3a997dca5a3d7e8157?hp=c093edd09880a1b87e82c8b6b11c8ccd0aca2d55 Work around evil compiler bug on OS X. (Sucks all memory) p4raw-id: //depot/perl@23101 --- diff --git a/util.c b/util.c index ad6d401..1892fec 100644 --- a/util.c +++ b/util.c @@ -3962,8 +3962,16 @@ Perl_scan_version(pTHX_ char *s, SV *rv, bool qv) } if ( qv ) { /* quoted versions always become full version objects */ I32 len = av_len((AV *)sv); - for ( len = 2 - len; len > 0; len-- ) - av_push((AV *)sv, newSViv(0)); + /* This for loop appears to trigger a compiler bug on OS X, as it + loops infinitely. Yes, len is negative. No, it makes no sense. + Compiler in question is: + gcc version 3.3 20030304 (Apple Computer, Inc. build 1640) + for ( len = 2 - len; len > 0; len-- ) + av_push((AV *)sv, newSViv(0)); + */ + len = 2 - len; + while (len-- > 0) + av_push((AV *)sv, newSViv(0)); } return s; }