From: Michael Beck Date: Fri, 30 May 2008 16:30:38 +0000 (+0000) Subject: handle a call with less arguments than needed gracefully: don't inline yet X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=a8a06f66c66fab835f88bda648db4b207fec21dd;p=libfirm handle a call with less arguments than needed gracefully: don't inline yet [r19859] --- 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);