diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-07-13 18:58:41 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-07-13 18:58:41 +0000 |
commit | 4edfc503949d80de79e38b3a997dca5a3d7e8157 (patch) | |
tree | 3cbfe663854e94306b6d1c4782ce4ebdea7fcb3d /util.c | |
parent | c093edd09880a1b87e82c8b6b11c8ccd0aca2d55 (diff) | |
download | perl-4edfc503949d80de79e38b3a997dca5a3d7e8157.tar.gz |
Work around evil compiler bug on OS X. (Sucks all memory)
p4raw-id: //depot/perl@23101
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; } |