aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/symbol.h
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-09 21:25:20 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-12 18:48:52 +0100
commit4bf8f31e91c88f7d2bc4e6de0c10b2b89d3093e2 (patch)
tree55708c7806bb2f48c440b7f521e1aa53ee4dbfc2 /symbol.h
parent54c243b16fdf43e4cc4bef6aad3e50bc0c32547c (diff)
downloadsparse-dev-4bf8f31e91c88f7d2bc4e6de0c10b2b89d3093e2.tar.gz
as-named: warn on bad address space
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'symbol.h')
-rw-r--r--symbol.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/symbol.h b/symbol.h
index 35e932d9..87d3ce53 100644
--- a/symbol.h
+++ b/symbol.h
@@ -508,7 +508,8 @@ static inline bool valid_as(struct ident *as)
return as && as != &bad_address_space;
}
-static inline void combine_address_space(struct ident **tas, struct ident *sas)
+static inline void combine_address_space(struct position pos,
+ struct ident **tas, struct ident *sas)
{
struct ident *as;
if (!sas)
@@ -516,8 +517,10 @@ static inline void combine_address_space(struct ident **tas, struct ident *sas)
as = *tas;
if (!as)
*tas = sas;
- else if (as != sas)
+ else if (as != sas) {
*tas = &bad_address_space;
+ sparse_error(pos, "multiple address spaces given");
+ }
}
#endif /* SYMBOL_H */