From 8c3859ebd876e503c5a15c78a6499ce6fedd1a95 Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Wed, 4 Jul 2018 19:27:52 +0200 Subject: [PATCH] Don't try to inline with a flattening callsite The args processing code never had to handle that case before (it is blocked much earlier, by simply never producing a candidate in that case), and so did completely bogus things. --- src/spesh/inline.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/spesh/inline.c b/src/spesh/inline.c index 7f68360d42..d701b86bea 100644 --- a/src/spesh/inline.c +++ b/src/spesh/inline.c @@ -212,6 +212,12 @@ MVMSpeshGraph * MVM_spesh_inline_try_get_graph_from_unspecialized(MVMThreadConte MVMSpeshCallInfo *call_info, char **no_inline_reason) { MVMSpeshGraph *ig; + /* Cannot inline with flattening args. */ + if (call_info->cs->has_flattening) { + *no_inline_reason = "callsite has flattening args"; + return NULL; + } + /* Check the target is suitable for inlining. */ if (!is_static_frame_inlineable(tc, inliner, target_sf, no_inline_reason)) return NULL;