Fix inlining switch statement.
commitc0719f0fbb21d16a786fdf202c7f424e40abf51b
authorChristopher Li <sparse@chrisli.org>
Sun, 14 Aug 2011 21:10:09 +0000 (14 14:10 -0700)
committerChristopher Li <sparse@chrisli.org>
Sun, 14 Aug 2011 22:00:48 +0000 (14 15:00 -0700)
tree519ce534b074b9b69a1b850f36dc75ec9da47549
parent5b57cb8105f9fe00119a12462f09f3106b1e6117
Fix inlining switch statement.

In sparse, inline is replacing the function call
expression with a compound statment of inline
function body. During the process, all reference
to the function arguments need to replaced with
calling arguments.

When inlining the case statement. Sparse forgets
to replace the case_label->stmt to the new version.
If it has inner inline function call, it will cause
the orignal copy of the function definition get
modified. That should never happen.

It cause warning error when the inline
function call the second time.

With this change, validations/bug_inline_switch.c
no longer generate warning.

Signed-off-by: Christopher Li <sparse@chrisli.org>
inline.c