diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-15 11:58:10 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:06:14 -0700 |
| commit | 2235458dce3d09df1f96e5bb514258311e2b79d8 (patch) | |
| tree | e8d7ad92fa7e9c5ed6928e71644d832a71981f71 /inline.c | |
| parent | d69224e8d81d6648b4a14383a28681724d47989d (diff) | |
| download | sparse-dev-2235458dce3d09df1f96e5bb514258311e2b79d8.tar.gz | |
inlining: don't copy an initializer expression for a symbol that
didn't get copied.
Test-case by Sam Ravnborg (inline function with static symbol with
initializer).
Diffstat (limited to 'inline.c')
| -rw-r--r-- | inline.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -416,7 +416,8 @@ void copy_statement(struct statement *src, struct statement *dst) FOR_EACH_PTR(src->syms, sym) { struct symbol *newsym = copy_symbol(src->pos, sym); - newsym->initializer = copy_expression(sym->initializer); + if (newsym != sym) + newsym->initializer = copy_expression(sym->initializer); add_symbol(&dst->syms, newsym); } END_FOR_EACH_PTR(sym); |
