[macruby-changes] [4833] MacRuby/trunk/bignum.c
source_changes at macosforge.org
source_changes at macosforge.org
Tue Oct 26 17:13:23 PDT 2010
Revision: 4833
http://trac.macosforge.org/projects/ruby/changeset/4833
Author: lsansonetti at apple.com
Date: 2010-10-26 17:13:20 -0700 (Tue, 26 Oct 2010)
Log Message:
-----------
disable a check when converting bignums into unsigned long longs as it may trigger false positives when using certain Cocoa APIs
Modified Paths:
--------------
MacRuby/trunk/bignum.c
Modified: MacRuby/trunk/bignum.c
===================================================================
--- MacRuby/trunk/bignum.c 2010-10-26 22:51:01 UTC (rev 4832)
+++ MacRuby/trunk/bignum.c 2010-10-27 00:13:20 UTC (rev 4833)
@@ -1103,10 +1103,15 @@
{
unsigned LONG_LONG num = big2ull(x, "long long");
+ // This check is disabled because this function might be called from
+ // compiler stubs which will pass negative values as long long times
+ // for certain Cocoa APIs (generally fixed values like -1 or -2).
+#if 0
if ((LONG_LONG)num < 0 && (RBIGNUM_SIGN(x)
|| (LONG_LONG)num != LLONG_MIN)) {
rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
}
+#endif
if (!RBIGNUM_SIGN(x)) return -(LONG_LONG)num;
return num;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101026/098c08bf/attachment.html>
More information about the macruby-changes
mailing list