Created
October 14, 2014 15:19
-
-
Save mrbrdo/d4d504fd3b222e229508 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct mrb_jmpbuf buf; | |
int stoff = mrb->c->stack - mrb->c->stbase; | |
int cioff = mrb->c->ci - mrb->c->cibase; | |
MRB_TRY(&buf) { | |
mrb->jmp = &buf; | |
} | |
MRB_CATCH(&buf) { | |
// if rescued from method that was called from this method | |
// and didn't have its own rescue | |
// fix global state, be careful if stbase or cibase changed | |
mrb->c->ci = mrb->c->cibase + cioff; | |
regs = mrb->c->stack = mrb->c->stbase + stoff; | |
// handle error | |
} | |
MRB_END_EXC(&buf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment