Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/x.diff Secret

Created September 7, 2017 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/323906079c443ad0e4be04309cd36ea5 to your computer and use it in GitHub Desktop.
Save jnthn/323906079c443ad0e4be04309cd36ea5 to your computer and use it in GitHub Desktop.
diff --git a/src/spesh/inline.c b/src/spesh/inline.c
index 5a883ba..b5cfaed 100644
--- a/src/spesh/inline.c
+++ b/src/spesh/inline.c
@@ -544,10 +544,13 @@ static void merge_graph(MVMThreadContext *tc, MVMSpeshGraph *inliner,
/* Only update these to the point we found the invoke
* being inlined, so it serves as a snapshot of what
* is active. */
- if (ann->type == MVM_SPESH_ANN_FH_START)
- active[ann->data.frame_handler_index] = 1;
+ MVMint32 fhidx = ann->data.frame_handler_index;
+ if (ann->type == MVM_SPESH_ANN_FH_START &&
+ (!inliner->unreachable_handlers ||
+ !inliner->unreachable_handlers[fhidx]))
+ active[fhidx] = 1;
else if (ann->type == MVM_SPESH_ANN_FH_END)
- active[ann->data.frame_handler_index] = 0;
+ active[fhidx] = 0;
}
ann = ann->next;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment