summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--time.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d62def0b36f..902a80b433a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu May 6 17:16:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * time.c (rb_localtime_r2): get rid of infinite loop bug of
+ localtime() on x86_64-darwin. [ruby-core:30031]
+
Thu May 6 15:56:12 2010 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/fiddle/*: Adding fiddle library to wrap libffi
diff --git a/time.c b/time.c
index f6d0f3a7cbb..62e42356036 100644
--- a/time.c
+++ b/time.c
@@ -863,6 +863,9 @@ rb_localtime_r(const time_t *tp, struct tm *result)
static struct tm *
rb_localtime_r2(const time_t *t, struct tm *result)
{
+#if defined __APPLE__ && defined __LP64__
+ if (*t != (time_t)(int)*t) return NULL;
+#endif
result = rb_localtime_r(t, result);
#if defined(HAVE_MKTIME) && defined(LOCALTIME_OVERFLOW_PROBLEM)
if (result) {