Last active
July 16, 2018 16:51
-
-
Save jnthn/f3a15e2902b43535f002d4ff60cdea4f to your computer and use it in GitHub Desktop.
This file contains 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
MVMSpeshFrameWalker fw; | |
MVM_spesh_frame_walker_init(tc, &fw, cur_caller_frame, 1); /* Or 0 to exclude lexical chains */ | |
while (MVM_spesh_frame_walker_next(tc, &fw)) { | |
MVMRegister *found; | |
MVMuint16 found_kind; | |
if (MVM_spesh_frame_walker_get_lex(tc, &fw, name, &found, &found_kind)) { | |
if (found_kind == MVM_reg_obj) { | |
return found; | |
} | |
else { | |
char *c_name = MVM_string_utf8_encode_C_string(tc, name); | |
char *waste[] = { c_name, NULL }; | |
MVM_exception_throw_adhoc_free(tc, waste, | |
"Lexical with name '%s' has wrong type", | |
c_name); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment