aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-06-22 19:16:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:53 -0700
commitf40c00a25222b3716f70be9865475ddca4ffb61f (patch)
tree92ce6022107a9b5d48e65a8ed55ee93c3819daf1 /inline.c
parentFlesh out inlining some more. (diff)
downloadsparse-f40c00a25222b3716f70be9865475ddca4ffb61f.tar.gz
sparse-f40c00a25222b3716f70be9865475ddca4ffb61f.tar.bz2
sparse-f40c00a25222b3716f70be9865475ddca4ffb61f.zip
Fix case statement inlining. At least partly.
Diffstat (limited to 'inline.c')
-rw-r--r--inline.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/inline.c b/inline.c
index 89b890c..ab37974 100644
--- a/inline.c
+++ b/inline.c
@@ -248,15 +248,11 @@ static struct statement *copy_one_statement(struct statement *stmt)
break;
}
case STMT_CASE: {
- struct symbol *sym = copy_symbol(stmt->case_label);
- struct expression *from = copy_expression(stmt->case_expression);
- struct expression *to = copy_expression(stmt->case_to);
- struct statement *stmt = copy_one_statement(stmt->case_statement);
stmt = dup_statement(stmt);
- stmt->case_expression = from;
- stmt->case_to = to;
- stmt->case_statement = stmt;
- stmt->case_label = sym;
+ stmt->case_label = copy_symbol(stmt->case_label);
+ stmt->case_expression = copy_expression(stmt->case_expression);
+ stmt->case_to = copy_expression(stmt->case_to);
+ stmt->case_statement = copy_one_statement(stmt->case_statement);
break;
}
case STMT_SWITCH: {