aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inline.c
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-02-04 18:24:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:06:21 -0700
commit4b369282cf9d36c1a7306d0d1571e39fa5b6bfaa (patch)
treed7f7c6b0a040e0fdc0bc9b095bab7903104bc91b /inline.c
parent13299c9883c735da478d6b413df99a07d5fb75a1 (diff)
downloadsparse-dev-4b369282cf9d36c1a7306d0d1571e39fa5b6bfaa.tar.gz
Add compile-time "range-check" infrastructure to sparse
Diffstat (limited to 'inline.c')
-rw-r--r--inline.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/inline.c b/inline.c
index 8b145c77..552ddb2b 100644
--- a/inline.c
+++ b/inline.c
@@ -294,7 +294,7 @@ static struct statement *copy_one_statement(struct statement *stmt)
switch(stmt->type) {
case STMT_NONE:
break;
- case STMT_INTERNAL:
+ case STMT_CONTEXT:
case STMT_EXPRESSION: {
struct expression *expr = copy_expression(stmt->expression);
if (expr == stmt->expression)
@@ -303,6 +303,14 @@ static struct statement *copy_one_statement(struct statement *stmt)
stmt->expression = expr;
break;
}
+ case STMT_RANGE: {
+ struct expression *expr = copy_expression(stmt->range_expression);
+ if (expr == stmt->expression)
+ break;
+ stmt = dup_statement(stmt);
+ stmt->range_expression = expr;
+ break;
+ }
case STMT_COMPOUND: {
struct statement *new = alloc_statement(stmt->pos, STMT_COMPOUND);
copy_statement(stmt, new);