Skip to content

Commit

Permalink
chore(austinp): clean up eval frame detection
Browse files Browse the repository at this point in the history
  • Loading branch information
P403n1x87 committed Oct 4, 2023
1 parent b031723 commit 90005bf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/py_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,12 +993,8 @@ py_thread__emit_collapsed_stack(py_thread_t * self, int64_t interp_id, ctime_t t
if (!isvalid(scope)) {
scope = UNKNOWN_SCOPE;
}
char * eval_frame_fn = scope == UNKNOWN_SCOPE ? NULL : strstr(scope, "PyEval_EvalFrame");
int is_frame_eval = FALSE;
if (isvalid(eval_frame_fn)) {
char c = *(eval_frame_fn+16);
is_frame_eval = (c == 'D');
}

int is_frame_eval = (scope == UNKNOWN_SCOPE) ? FALSE : isvalid(strstr(scope, "PyEval_EvalFrameDefault"));
if (!stack_is_empty() && is_frame_eval) {
// TODO: if the py stack is empty we have a mismatch.
frame_t * frame = stack_pop();
Expand Down

0 comments on commit 90005bf

Please sign in to comment.