diff options
author | Christopher Li <sparse@chrisli.org> | 2008-12-25 14:20:38 -0800 |
---|---|---|
committer | Christopher Li <sparse@chrisli.org> | 2008-12-25 14:20:38 -0800 |
commit | eb8559bf861c94ab7958105efa812b21e1da2d51 (patch) | |
tree | e0ec69d08b91a468f7c2838e61e8a7c8d013c162 /evaluate.c | |
parent | Revert the context tracking code (diff) | |
download | sparse-eb8559bf861c94ab7958105efa812b21e1da2d51.tar.gz sparse-eb8559bf861c94ab7958105efa812b21e1da2d51.tar.bz2 sparse-eb8559bf861c94ab7958105efa812b21e1da2d51.zip |
Teach classify_type to handle typeof
This change will fix Rusty Russel's test case:
(*(typeof(v) __attribute__((address_space(0), force)) *)(&v))
Signed-Off-By: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'evaluate.c')
-rw-r--r-- | evaluate.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -362,6 +362,11 @@ static inline int classify_type(struct symbol *type, struct symbol **base) }; if (type->type == SYM_NODE) type = type->ctype.base_type; + if (type->type == SYM_TYPEOF) { + type = evaluate_expression(type->initializer); + if (type->type == SYM_NODE) + type = type->ctype.base_type; + } if (type->type == SYM_ENUM) type = type->ctype.base_type; *base = type; |