[macruby-changes] [3788] MacRuby/trunk/ext/bigdecimal/bigdecimal.c
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 17 18:05:05 PDT 2010
Revision: 3788
http://trac.macosforge.org/projects/ruby/changeset/3788
Author: martinlagardette at apple.com
Date: 2010-03-17 18:05:03 -0700 (Wed, 17 Mar 2010)
Log Message:
-----------
Avoid integer truncation in BigDecimal
In a 64-bit program, if mb is > 2^32, the amount to allocate will be truncated to a 32-bit unsigned integer, but then the amount to memset will use the full 64-bit number."
- Fixes 7697476
Modified Paths:
--------------
MacRuby/trunk/ext/bigdecimal/bigdecimal.c
Modified: MacRuby/trunk/ext/bigdecimal/bigdecimal.c
===================================================================
--- MacRuby/trunk/ext/bigdecimal/bigdecimal.c 2010-03-17 21:35:16 UTC (rev 3787)
+++ MacRuby/trunk/ext/bigdecimal/bigdecimal.c 2010-03-18 01:05:03 UTC (rev 3788)
@@ -2020,7 +2020,7 @@
VP_EXPORT void *
VpMemAlloc(U_LONG mb)
{
- void *p = xmalloc((unsigned int)mb);
+ void *p = xmalloc(mb);
if(!p) {
VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100317/f05ee304/attachment-0001.html>
More information about the macruby-changes
mailing list