diff --git a/evaluate.c b/evaluate.c index f1a266be..b7bb1f52 100644 --- a/evaluate.c +++ b/evaluate.c @@ -3107,22 +3107,6 @@ static int evaluate_symbol_call(struct expression *expr) if (ctype->op && ctype->op->evaluate) return ctype->op->evaluate(expr); - if (ctype->ctype.modifiers & MOD_INLINE) { - int ret; - struct symbol *curr = current_fn; - - if (ctype->definition) - ctype = ctype->definition; - - current_fn = ctype->ctype.base_type; - - ret = inline_function(expr, ctype); - - /* restore the old function */ - current_fn = curr; - return ret; - } - return 0; } diff --git a/expand.c b/expand.c index 36612c86..a4f26461 100644 --- a/expand.c +++ b/expand.c @@ -910,6 +910,15 @@ static int expand_symbol_call(struct expression *expr, int cost) if (fn->type != EXPR_PREOP) return SIDE_EFFECTS; + if (ctype->ctype.modifiers & MOD_INLINE) { + struct symbol *def; + + def = ctype->definition ? ctype->definition : ctype; + if (inline_function(expr, def)) + return expand_expression(expr); + } + + if (ctype->op && ctype->op->expand) return ctype->op->expand(expr, cost);