diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 12:00:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 12:00:10 +0000 |
commit | 98ab1510c47505702e876f7f871cd033d58c387d (patch) | |
tree | 68a010a771af2974698a9978abf2d713863f1168 /vm_trace.c | |
parent | f5c5a1979a621a1f09e840fa421e71279b3530f8 (diff) | |
download | ruby-98ab1510c47505702e876f7f871cd033d58c387d.tar.gz |
vm_trace.c: suppress -Wclobbered warning
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vm_trace.c b/vm_trace.c index 39d2a062db..9a7f0cc087 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -378,8 +378,8 @@ rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg) { volatile int raised; VALUE result = Qnil; - rb_execution_context_t *ec = GET_EC(); - rb_vm_t *vm = rb_ec_vm_ptr(ec); + rb_execution_context_t *const ec = GET_EC(); + rb_vm_t *const vm = rb_ec_vm_ptr(ec); enum ruby_tag_type state; rb_trace_arg_t dummy_trace_arg; dummy_trace_arg.event = 0; @@ -392,9 +392,12 @@ rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg) raised = rb_ec_reset_raised(ec); EC_PUSH_TAG(ec); - if ((state = EC_EXEC_TAG()) == TAG_NONE) { + if (LIKELY((state = EC_EXEC_TAG()) == TAG_NONE)) { result = (*func)(arg); } + else { + (void)*&vm; /* suppress "clobbered" warning */ + } EC_POP_TAG(); if (raised) { |