summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--vm_trace.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 86ac3d6351..2ea6f3b050 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon May 2 00:41:53 2016 Tanaka Akira <akr@fsij.org>
+
+ * vm_trace.c (recalc_remove_ruby_vm_event_flags): Add a cast to
+ avoid signed integer overflow.
+
Mon May 2 00:06:04 2016 Tanaka Akira <akr@fsij.org>
* test/lib/envutil.rb: Define Integer::{FIXNUM_MIN,FIXNUM_MAX}.
diff --git a/vm_trace.c b/vm_trace.c
index 673739eb20..a84821e2b0 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -81,7 +81,7 @@ recalc_remove_ruby_vm_event_flags(rb_event_flag_t events)
ruby_vm_event_flags = 0;
for (i=0; i<MAX_EVENT_NUM; i++) {
- if (events & (1 << i)) {
+ if (events & ((rb_event_flag_t)1 << i)) {
ruby_event_flag_count[i]--;
}
ruby_vm_event_flags |= ruby_event_flag_count[i] ? (1<<i) : 0;