summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-07-13 18:58:41 +0000
committerNicholas Clark <nick@ccl4.org>2004-07-13 18:58:41 +0000
commit4edfc503949d80de79e38b3a997dca5a3d7e8157 (patch)
tree3cbfe663854e94306b6d1c4782ce4ebdea7fcb3d /util.c
parentc093edd09880a1b87e82c8b6b11c8ccd0aca2d55 (diff)
downloadperl-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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/util.c b/util.c
index ad6d40156f..1892fec3f5 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;
}