summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-04 05:05:38 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-04 05:05:38 (GMT)
commit47bb1804cbe9df69c2c2dd1d127482057095c429 (patch)
treede434caf3a3f4c80d7893222ffb55043fdb1f499
parent2ae40aef636f6e0b92e99fe5baf2b263c229c64d (diff)
merge revision(s) 18211:
* bignum.c (rb_big2str0, bigsqr): made interruptible. [ruby-Bugs-20622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@18339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c5
-rw-r--r--common.mk3
-rw-r--r--version.h2
4 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c027e52..d2104e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 4 13:53:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (rb_big2str0, bigsqr): made interruptible. [ruby-Bugs-20622]
+
Mon Aug 4 13:31:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): fixed wrong check
diff --git a/bignum.c b/bignum.c
index be28703..7f14aee 100644
--- a/bignum.c
+++ b/bignum.c
@@ -11,6 +11,7 @@
**********************************************************************/
#include "ruby.h"
+#include "rubysig.h"
#include <math.h>
#include <float.h>
@@ -720,6 +721,7 @@ rb_big2str0(x, base, trim)
s = RSTRING(ss)->ptr;
s[0] = RBIGNUM(x)->sign ? '+' : '-';
+ TRAP_BEG;
while (i && j > 1) {
long k = i;
BDIGIT_DBL num = 0;
@@ -749,6 +751,7 @@ rb_big2str0(x, base, trim)
RSTRING(ss)->len = i;
}
s[RSTRING(ss)->len] = '\0';
+ TRAP_END;
return ss;
}
@@ -1735,11 +1738,13 @@ bigsqr(x)
RBIGNUM(z)->len = len;
a2 = bigtrunc(rb_big_mul0(a, b));
len = RBIGNUM(a2)->len;
+ TRAP_BEG;
for (i = 0, num = 0; i < len; i++) {
num += (BDIGIT_DBL)BDIGITS(z)[i + k] + ((BDIGIT_DBL)BDIGITS(a2)[i] << 1);
BDIGITS(z)[i + k] = BIGLO(num);
num = BIGDN(num);
}
+ TRAP_END;
if (num) {
len = RBIGNUM(z)->len;
for (i += k; i < len && num; ++i) {
diff --git a/common.mk b/common.mk
index 50ec183..bf49aad 100644
--- a/common.mk
+++ b/common.mk
@@ -362,7 +362,8 @@ array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}util.h {$(VPATH)}st.h
bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h config.h \
- {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
+ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}rubysig.h
class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}rubysig.h {$(VPATH)}node.h {$(VPATH)}st.h
diff --git a/version.h b/version.h
index 8a057ea..1bb57db 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-08-04"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080804
-#define RUBY_PATCHLEVEL 66
+#define RUBY_PATCHLEVEL 67
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8