aboutsummaryrefslogtreecommitdiff
path: root/lang/ruby18
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2008-06-25 23:00:28 +0000
committerStanislav Sedov <stas@FreeBSD.org>2008-06-25 23:00:28 +0000
commit5027cd7b724add7e71ec509036fec9a49a0dd84c (patch)
treeaed855c29eb57ccf72df82f85cf43b357813ec4c /lang/ruby18
parenta530ab018bb7985ab8120d5a5264147f8baef180 (diff)
downloadports-5027cd7b724add7e71ec509036fec9a49a0dd84c.tar.gz
ports-5027cd7b724add7e71ec509036fec9a49a0dd84c.zip
Notes
Diffstat (limited to 'lang/ruby18')
-rw-r--r--lang/ruby18/files/patch-bignum.c12
-rw-r--r--lang/ruby18/files/patch-parse.c19
-rw-r--r--lang/ruby18/files/patch-regex.c14
3 files changed, 45 insertions, 0 deletions
diff --git a/lang/ruby18/files/patch-bignum.c b/lang/ruby18/files/patch-bignum.c
new file mode 100644
index 000000000000..6bb648daf0b3
--- /dev/null
+++ b/lang/ruby18/files/patch-bignum.c
@@ -0,0 +1,12 @@
+--- bignum.c.orig 2007-09-19 06:13:21.000000000 +0400
++++ bignum.c 2008-06-26 01:54:38.000000000 +0400
+@@ -652,6 +652,9 @@
+ if (BIGZEROP(x)) {
+ return rb_str_new2("0");
+ }
++ if (i >= LONG_MAX/SIZEOF_BDIGITS/CHAR_BIT) {
++ rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
++ }
+ j = SIZEOF_BDIGITS*CHAR_BIT*i;
+ switch (base) {
+ case 2: break;
diff --git a/lang/ruby18/files/patch-parse.c b/lang/ruby18/files/patch-parse.c
new file mode 100644
index 000000000000..ae35f9f316ac
--- /dev/null
+++ b/lang/ruby18/files/patch-parse.c
@@ -0,0 +1,19 @@
+--- parse.c.orig 2008-06-26 01:19:07.000000000 +0400
++++ parse.c 2008-06-26 01:20:12.000000000 +0400
+@@ -10705,7 +10705,7 @@
+ rb_mem_clear(vars+i, len-i);
+ }
+ else {
+- *vars++ = (VALUE)ruby_scope;
++ *vars++ = 0;
+ rb_mem_clear(vars, len);
+ }
+ ruby_scope->local_vars = vars;
+@@ -10721,6 +10721,7 @@
+ if (!(ruby_scope->flags & SCOPE_CLONE))
+ xfree(ruby_scope->local_tbl);
+ }
++ ruby_scope->local_vars[-1] = 0; /* no reference needed */
+ ruby_scope->local_tbl = local_tbl();
+ }
+ }
diff --git a/lang/ruby18/files/patch-regex.c b/lang/ruby18/files/patch-regex.c
new file mode 100644
index 000000000000..16451e45807e
--- /dev/null
+++ b/lang/ruby18/files/patch-regex.c
@@ -0,0 +1,14 @@
+--- regex.c.orig 2008-06-26 01:17:14.000000000 +0400
++++ regex.c 2008-06-26 01:18:42.000000000 +0400
+@@ -3169,6 +3169,11 @@
+ if (startpos < 0 || startpos > size)
+ return -1;
+
++ if (!string) {
++ if (size == 0) string = "";
++ else return -1;
++ }
++
+ /* Update the fastmap now if not correct already. */
+ if (fastmap && !bufp->fastmap_accurate) {
+ re_compile_fastmap(bufp);