From a8a06f66c66fab835f88bda648db4b207fec21dd Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 30 May 2008 16:30:38 +0000 Subject: [PATCH] handle a call with less arguments than needed gracefully: don't inline yet [r19859] --- ir/opt/opt_inline.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ir/opt/opt_inline.c b/ir/opt/opt_inline.c index b12e7ef9f..6a605d4d4 100644 --- a/ir/opt/opt_inline.c +++ b/ir/opt/opt_inline.c @@ -863,8 +863,12 @@ int inline_method(ir_node *call, ir_graph *called_graph) { /* types match, fine: when the frame is access, the inliner stops at can_inline() */ } - assert(get_method_n_params(get_entity_type(ent)) == - get_method_n_params(get_Call_type(call))); + if (get_method_n_params(get_entity_type(ent)) > get_method_n_params(get_Call_type(call))) { + /* this is a bad feature of C: without a prototype, we can can call a function with less + parameters than needed. Currently we don't support this, although it would be + to use Unknown than. */ + return 0; + } irg = get_irn_irg(call); -- 2.20.1