Project

General

Profile

Bug #1018 ยป return_from_eclass.patch

wanabe (_ wanabe), 01/15/2010 12:28 AM

View differences:

vm_insnhelper.c (working copy)
else if (state == TAG_RETURN) {
rb_control_frame_t *cfp = GET_CFP();
VALUE *dfp = GET_DFP();
VALUE * const lfp = GET_LFP();
VALUE *lfp = GET_LFP();
/* check orphan and get dfp */
while ((VALUE *) cfp < th->stack + th->stack_size) {
if (!lfp) {
lfp = cfp->lfp;
}
if (cfp->dfp == lfp && cfp->iseq->type == ISEQ_TYPE_CLASS) {
lfp = 0;
}
if (cfp->lfp == lfp) {
if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_LAMBDA) {
VALUE *tdfp = dfp;
compile.c (working copy)
rb_iseq_t *is = iseq;
if (is) {
if (is->type == ISEQ_TYPE_TOP || is->type == ISEQ_TYPE_CLASS) {
if (is->type == ISEQ_TYPE_TOP) {
COMPILE_ERROR((ERROR_ARGS "Invalid return"));
}
else {
    (1-1/1)