diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-17 18:07:08 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-17 18:07:08 +0000 |
commit | ded40392317c885439232de5f7da3519ebce4ee5 (patch) | |
tree | b2316123d28af6ea21432bc8906070abeb55c2e5 /eval_intern.h | |
parent | 69f86f79e25d7e0bd56f9967d2f3905a9cd4a26e (diff) |
merge revision(s) 56252,56254: [Backport #12743]
* eval_intern.h (TH_PUSH_TAG): Initialize struct rb_vm_tag::tag with
Qundef rather than 0 which is equal to Qfalse. Since Kernel#throw(obj)
searches a tag with rb_vm_tag::tag == obj, throw(false) can
accidentally find an unrelated tag which is not created by
Kernel#catch. [ruby-core:77229] [Bug #12743]
* test/ruby/test_exception.rb (test_throw_false): Add a test case for
this.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r-- | eval_intern.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/eval_intern.h b/eval_intern.h index 9c2b8960dc..85c606ecb2 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -121,7 +121,7 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *); #define TH_PUSH_TAG(th) do { \ rb_thread_t * const _th = (th); \ struct rb_vm_tag _tag; \ - _tag.tag = 0; \ + _tag.tag = Qundef; \ _tag.prev = _th->tag; #define TH_POP_TAG() \ |