From c8e47177fccb1af0c0f082a2836f53c86d3a652d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 2 Jan 2019 12:05:32 -0800 Subject: [PATCH] Add an assert to `append_ebb_params_for_function_params`. --- lib/frontend/src/frontend.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 2ed09fbd01..d769b678f8 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -405,6 +405,11 @@ impl<'a> FunctionBuilder<'a> { /// parameters. This can be used to set up the ebb parameters for the /// entry block. pub fn append_ebb_params_for_function_params(&mut self, ebb: Ebb) { + debug_assert!( + !self.func_ctx.ssa.has_any_predecessors(ebb), + "ebb parameters for function parameters should only be added to the entry block" + ); + // These parameters count as "user" parameters here because they aren't // inserted by the SSABuilder. let user_param_count = &mut self.func_ctx.ebbs[ebb].user_param_count;