From: usa@... Date: 2016-10-27T07:48:56+00:00 Subject: [ruby-core:77781] [Ruby trunk Bug#12743] throw(false) does not work as expected Issue #12743 has been updated by Usaku NAKAMURA. Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: DONE to 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE ruby_2_2 r56505 merged revision(s) 56252,56254. ---------------------------------------- Bug #12743: throw(false) does not work as expected https://bugs.ruby-lang.org/issues/12743#change-61085 * Author: Kazuki Yamaguchi * Status: Closed * Priority: Normal * Assignee: * ruby -v: ruby 2.4.0dev (2016-09-09 trunk 56124) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE ---------------------------------------- I expect UncaughtThrowError for these examples: ~~~ $ ruby -e'throw false' -e: unexpected throw $ ruby -e'Fiber.new{throw false}.resume' $ ruby -e'Thread.new{throw false}.join' -e:1: [BUG] thread_join: THROW_DATA should not reach here. ruby 2.4.0dev (2016-09-09 trunk 56124) [x86_64-linux] -- Control frame information ----------------------------------------------- ~~~ The cause is that Kernel#throw incorrectly finds a tag that is not created by Kernel#catch, because TH_PUSH_TAG() initializes rb_vm_tag::tag with 0. The attached patch seems to fix the issue, by making TH_PUSH_TAG() initialize with Qundef that should never appear in Ruby code. ---Files-------------------------------- 0001-eval_intern.h-make-TH_PUSH_TAG-initialize-rb_vm_tag-.patch (1.53 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: