diff options
author | Christopher Li <sparse@chrisli.org> | 2004-08-03 23:52:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:02:36 -0700 |
commit | f439331f2501667d6ff553208010d44034c924f6 (patch) | |
tree | 87633059b3ce254aebf007180f3bd6aac1e75027 /inline.c | |
parent | 467ba842a51dfdaae9312938fe868792705028a3 (diff) | |
download | sparse-f439331f2501667d6ff553208010d44034c924f6.tar.gz |
[PATCH] Avoid recursive inline function expansion
Ideally we should probably allocate an error code for recursive expand,
so the caller can know that the inline did not expand at all.
But the evaluate_symbol_call don't care about that so I just make it
reutrn 0.
Diffstat (limited to 'inline.c')
-rw-r--r-- | inline.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -407,6 +407,10 @@ int inline_function(struct expression *expr, struct symbol *sym) warn(fn->pos, "marked inline, but without a definition"); return 0; } + if (fn->expanding) + return 0; + fn->expanding = 1; + name_list = fn->arguments; stmt = alloc_statement(expr->pos, STMT_COMPOUND); @@ -440,5 +444,6 @@ int inline_function(struct expression *expr, struct symbol *sym) evaluate_statement(stmt); + fn->expanding = 0; return 1; } |