void CallFrame::set_last_match(STATE, Object* obj) { CallFrame* use = this->top_ruby_frame(); while(use && use->is_inline_block()) { CallFrame* yielder = use->previous; if(!yielder) return; // This works because the creator is always one above // the yielder with inline blocks. use = yielder->previous; } if(!use) return; use->scope->set_last_match(state, obj); }
CallFrame* VM::get_variables_frame(ssize_t up) { CallFrame* frame = call_frame_; while(frame && up-- > 0) { frame = frame->previous; } while(frame) { if(!frame->is_inline_block() && !frame->native_method_p() && frame->scope) { return frame; } frame = frame->previous; } return NULL; }