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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4edfc503949d80de79e38b3a997dca5a3d7e8157;p=p5sagit%2Fp5-mst-13.2.git 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; }