diff options
| author | Linus Torvalds <torvalds@penguin.transmeta.com> | 2003-04-09 16:26:04 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:00:25 -0700 |
| commit | e70d8c82896fea6d33c6cf78d083ca7a943252fa (patch) | |
| tree | 191db2673870ab46b76eb56ddc04242c8f27980e | |
| parent | bbd57e9990529223b129893b7b764d3a6ec856ba (diff) | |
| download | sparse-dev-e70d8c82896fea6d33c6cf78d083ca7a943252fa.tar.gz | |
We should _not_ look at the node modifiers/address_space
when we dereference it, since those are node-local.
| -rw-r--r-- | evaluate.c | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -391,20 +391,14 @@ static const char * type_difference(struct symbol *target, struct symbol *source * Peel of per-node information. * FIXME! Check alignment, address space, and context too here! */ + if (target->type == SYM_NODE) + target = target->ctype.base_type; + if (source->type == SYM_NODE) + source = source->ctype.base_type; mod1 = target->ctype.modifiers; as1 = target->ctype.as; mod2 = source->ctype.modifiers; as2 = source->ctype.as; - if (target->type == SYM_NODE) { - target = target->ctype.base_type; - mod1 |= target->ctype.modifiers; - as1 |= target->ctype.as; - } - if (source->type == SYM_NODE) { - source = source->ctype.base_type; - mod2 |= source->ctype.modifiers; - as2 |= source->ctype.as; - } if (target->type != source->type) { int type1 = target->type; @@ -1036,12 +1030,10 @@ static struct symbol *evaluate_member_dereference(struct expression *expr) } ctype = deref->ctype; + if (ctype->type == SYM_NODE) + ctype = ctype->ctype.base_type; mod = ctype->ctype.modifiers; address_space = ctype->ctype.as; - if (ctype->type == SYM_NODE) { - ctype = ctype->ctype.base_type; - mod |= ctype->ctype.modifiers; - } if (expr->op == SPECIAL_DEREFERENCE) { /* Arrays will degenerate into pointers for '->' */ if (ctype->type != SYM_PTR && ctype->type != SYM_ARRAY) { |
