Skip to content

Commit

Permalink
Fix inline boundary end annotation motion
Browse files Browse the repository at this point in the history
It's a frame handler in the sense that it goes into that table, but we
need to need to move it like the inline end handler. Otherwise, we can
get an off-by-one.
  • Loading branch information
jnthn committed Apr 9, 2019
1 parent 9cd8a06 commit c4396d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/spesh/manipulate.c
Expand Up @@ -28,7 +28,15 @@ void MVM_spesh_manipulate_delete_ins(MVMThreadContext *tc, MVMSpeshGraph *g,
while (ins->annotations) {
MVMSpeshAnn *ann = ins->annotations;
MVMSpeshAnn *ann_next = ann->next;
switch (ann->type) {
/* Special case: we make fake entires into the handler table for
* a handler that covers the whole inline, so we can proprerly
* process inline boundaries. Those need to move line an inline
* end annotation. */
int tweaked_type = ann->type == MVM_SPESH_ANN_FH_END &&
g->handlers[ann->data.frame_handler_index].category_mask == MVM_EX_INLINE_BOUNDARY
? MVM_SPESH_ANN_INLINE_END
: ann->type;
switch (tweaked_type) {
case MVM_SPESH_ANN_FH_START:
case MVM_SPESH_ANN_FH_GOTO:
case MVM_SPESH_ANN_INLINE_START:
Expand Down

0 comments on commit c4396d2

Please sign in to comment.