summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 08:41:44 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 08:41:44 (GMT)
commit5b40cb6a2cc6085a346f0f34be03b6ffdaeda8ca (patch)
tree67211fab4ded1d08a0aa737446a5f20428b599a2 /vm_trace.c
parent079009fb93678e902777669c663ed6f651a05c85 (diff)
* vm_trace.c: prohibit to specify normal events and internal events
simultaneously. I will introduce special care for internal events later. * ext/-test-/tracepoint/tracepoint.c: test this behavior. * test/-ext-/tracepoint/test_tracepoint.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vm_trace.c b/vm_trace.c
index 5930274..369bd7c 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -105,7 +105,13 @@ thval2thread_t(VALUE thval)
static rb_event_hook_t *
alloc_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flags)
{
- rb_event_hook_t *hook = ALLOC(rb_event_hook_t);
+ rb_event_hook_t *hook;
+
+ if ((events & RUBY_INTERNAL_EVENT_MASK) && (events & ~RUBY_INTERNAL_EVENT_MASK)) {
+ rb_raise(rb_eTypeError, "Can not specify normal event and internal event simultaneously.");
+ }
+
+ hook = ALLOC(rb_event_hook_t);
hook->hook_flags = hook_flags;
hook->events = events;
hook->func = func;