Skip to content

Commit

Permalink
be extra careful about prev
Browse files Browse the repository at this point in the history
a speshresolve being the first instruction in
a BB could cause a null pointer deref here.
  • Loading branch information
timo committed Jul 24, 2018
1 parent 389a3a1 commit ebf0464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spesh/optimize.c
Expand Up @@ -2328,7 +2328,7 @@ static void optimize_bb_switch(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshB
optimize_plugin(tc, g, bb, ins, p);
if (ins->info->opcode != MVM_OP_speshresolve
&& ins->info->opcode != MVM_OP_sp_speshresolve) {
if (prev->prev)
if (prev && prev->prev)
ins = prev->prev;
}
}
Expand Down

0 comments on commit ebf0464

Please sign in to comment.