aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-23 15:28:37 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:03:18 -0700
commit780e9a96de1f2c0ef9065831699720967681468d (patch)
treedf5215d738590aec319809318106fad869182d37 /show-parse.c
parentFor functions that lack a type, print out error rather than SIGSEGV. (diff)
downloadsparse-780e9a96de1f2c0ef9065831699720967681468d.tar.gz
sparse-780e9a96de1f2c0ef9065831699720967681468d.tar.bz2
sparse-780e9a96de1f2c0ef9065831699720967681468d.zip
Allow 'show_position_expr()' to survive lack of type information.
Again, this allows us to continue past errors.
Diffstat (limited to 'show-parse.c')
-rw-r--r--show-parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/show-parse.c b/show-parse.c
index ae45354..3f03749 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -915,9 +915,12 @@ static int show_position_expr(struct expression *expr, struct symbol *base)
{
int new = show_expression(expr->init_expr);
struct symbol *ctype = expr->init_expr->ctype;
+ int bit_offset;
+
+ bit_offset = ctype ? ctype->bit_offset : -1;
printf("\tinsert v%d at [%d:%d] of %s\n", new,
- expr->init_offset, ctype->bit_offset,
+ expr->init_offset, bit_offset,
show_ident(base->ident));
return 0;
}