Skip to content

Commit

Permalink
Merge pull request #207 from P403n1x87/chore/austinp-cleanup-eval-fra…
Browse files Browse the repository at this point in the history
…me-detection

chore(austinp): clean up eval frame detection
  • Loading branch information
P403n1x87 committed Oct 4, 2023
2 parents 3263bd7 + e8fa0e0 commit 6c4ac01
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 6c4ac01

Please sign in to comment.