Skip to content

Commit

Permalink
Remove always-false null checks
Browse files Browse the repository at this point in the history
There will always be at least one callstack record below an executing
frame record, and if that is a region start, it means there's a whole
region of records prior to it. Spotted by mlschroe++.
  • Loading branch information
jnthn committed Sep 10, 2021
1 parent 325625c commit 4bcc5a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/args.c
Expand Up @@ -1081,7 +1081,7 @@ void MVM_args_bind_failed(MVMThreadContext *tc, MVMDispInlineCacheEntry **ice_pt
* bind failure handler. This is determined by if there is a bind failure
* frame under us on the callstack in a fresh state. */
MVMCallStackRecord *under_us = tc->stack_top->prev;
while (under_us && under_us->kind == MVM_CALLSTACK_RECORD_START_REGION)
while (under_us->kind == MVM_CALLSTACK_RECORD_START_REGION)
under_us = under_us->prev;
if (under_us->kind == MVM_CALLSTACK_RECORD_BIND_CONTROL) {
MVMCallStackBindControl *control_record = (MVMCallStackBindControl *)under_us;
Expand Down Expand Up @@ -1119,7 +1119,7 @@ void MVM_args_bind_failed(MVMThreadContext *tc, MVMDispInlineCacheEntry **ice_pt
* dispatch resumption. */
void MVM_args_bind_succeeded(MVMThreadContext *tc, MVMDispInlineCacheEntry **ice_ptr) {
MVMCallStackRecord *under_us = tc->stack_top->prev;
while (under_us && under_us->kind == MVM_CALLSTACK_RECORD_START_REGION)
while (under_us->kind == MVM_CALLSTACK_RECORD_START_REGION)
under_us = under_us->prev;
if (under_us->kind == MVM_CALLSTACK_RECORD_BIND_CONTROL) {
MVMCallStackBindControl *control_record = (MVMCallStackBindControl *)under_us;
Expand Down

0 comments on commit 4bcc5a0

Please sign in to comment.