mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
merges r27714 from trunk into ruby_1_9_2.
-- * compile.c (iseq_compile_each), vm_insnhelper.c (vm_invoke_block, vm_throw): allow "return" and "yield" even in singleton class definition. based on a patch from wanabe <s.wanabe AT gmail.com> for "return". [ruby-core:21379] [ruby-dev:40975] * insns.def (defineclass): ditto (straightforwardly push block ptr, instead of dfp ptr with special flag). * vm_core.h (RUBY_VM_CLASS_SPECIAL_P): ditto (no longer needed). * proc.c (proc_new): ditto (remove handling for special flag). * bootstraptest/test_jump.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7dce73a295
commit
cff0cfc4db
8 changed files with 60 additions and 13 deletions
6
proc.c
6
proc.c
|
@ -380,16 +380,14 @@ proc_new(VALUE klass, int is_lambda)
|
|||
rb_control_frame_t *cfp = th->cfp;
|
||||
rb_block_t *block;
|
||||
|
||||
if ((GC_GUARDED_PTR_REF(cfp->lfp[0])) != 0 &&
|
||||
!RUBY_VM_CLASS_SPECIAL_P(cfp->lfp[0])) {
|
||||
if ((GC_GUARDED_PTR_REF(cfp->lfp[0])) != 0) {
|
||||
|
||||
block = GC_GUARDED_PTR_REF(cfp->lfp[0]);
|
||||
}
|
||||
else {
|
||||
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
|
||||
|
||||
if ((GC_GUARDED_PTR_REF(cfp->lfp[0])) != 0 &&
|
||||
!RUBY_VM_CLASS_SPECIAL_P(cfp->lfp[0])) {
|
||||
if ((GC_GUARDED_PTR_REF(cfp->lfp[0])) != 0) {
|
||||
|
||||
block = GC_GUARDED_PTR_REF(cfp->lfp[0]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue