summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-25 09:25:20 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-25 09:25:20 +0000
commit4e125b59e1d6cf0c8b06a9fb36f1c437c42378ad (patch)
tree601ec93bfd35c68302bdb19d2a5f332545bdf80e
parent477c282a079a1784a0b8c236e7449712be07cae4 (diff)
downloadruby-4e125b59e1d6cf0c8b06a9fb36f1c437c42378ad.tar.gz
merge revision(s) 54172: [Backport #12192]
* parse.y (parse_numvar): NTH_REF must be less than a half of INT_MAX, as it is left-shifted to be ORed with back-ref flag. [ruby-core:74444] [Bug#12192] [Fix GH-1296] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@54275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--parse.y2
-rw-r--r--version.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8afb37e428..1c388d7388 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Mar 25 18:24:04 2016 Victor Nawothnig <Victor.Nawothnig@gmail.com>
+
+ * parse.y (parse_numvar): NTH_REF must be less than a half of
+ INT_MAX, as it is left-shifted to be ORed with back-ref flag.
+ [ruby-core:74444] [Bug#12192] [Fix GH-1296]
+
Fri Mar 25 18:18:29 2016 Eric Hodel <drbrain@segment7.net>
* marshal.c (r_object0): raise ArgumentError when linking to undefined
diff --git a/parse.y b/parse.y
index 8f8bed499b..70258e34fb 100644
--- a/parse.y
+++ b/parse.y
@@ -6965,7 +6965,7 @@ parse_numvar(struct parser_params *parser)
int overflow;
unsigned long n = ruby_scan_digits(tok()+1, toklen()-1, 10, &len, &overflow);
const unsigned long nth_ref_max =
- (FIXNUM_MAX / 2 < INT_MAX) ? FIXNUM_MAX / 2 : INT_MAX;
+ ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
/* NTH_REF is left-shifted to be ORed with back-ref flag and
* turned into a Fixnum, in compile.c */
diff --git a/version.h b/version.h
index b6a5271be4..9604eefea0 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.9"
#define RUBY_RELEASE_DATE "2016-03-25"
-#define RUBY_PATCHLEVEL 472
+#define RUBY_PATCHLEVEL 473
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 3