summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 4e424201a2..0f2b0706c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Mar 29 01:27:52 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]
+
Tue Mar 29 01:24:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
* enc/trans/JIS: update Unicode's notice. [Bug #11844]
diff --git a/parse.y b/parse.y
index 37c7fd04e1..32ca4c8be9 100644
--- a/parse.y
+++ b/parse.y
@@ -7608,7 +7608,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 7e9a7955c2..48ccf3032b 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.2.5"
#define RUBY_RELEASE_DATE "2016-03-29"
-#define RUBY_PATCHLEVEL 277
+#define RUBY_PATCHLEVEL 278
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 3