aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparse.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-05-29 04:25:56 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-09-06 01:37:32 +0200
commit15fa4d60ebba3025495bb34f0718764336d3dfe0 (patch)
tree8181fe37ffeb90f76f72da3363ba97ff75cb084c /sparse.c
parent448a527590b1446f7625d8b3280eb94c9a757702 (diff)
downloadsparse-dev-15fa4d60ebba3025495bb34f0718764336d3dfe0.tar.gz
topasm: top-level asm is special
Top-level ASM statements are parsed as fake anonymous functions. Obviously, they have few in common with functions (for example, they don't have a return type) and mixing the two makes things more complicated than needed (for example, to detect a top-level ASM, we had to check that the corresponding symbol (name) had a null ident). Avoid potential problems by special casing them and return early in linearize_fn(). As consequence, they now don't have anymore an OP_ENTRY as first instructions and can be detected by testing ep->entry. Note: It would be more logical to catch them even erlier, in linearize_symbol() but they also need an entrypoint and an active BB so that we can generate the single statement. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.c')
-rw-r--r--sparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sparse.c b/sparse.c
index 6a445a17..975c0a4b 100644
--- a/sparse.c
+++ b/sparse.c
@@ -315,7 +315,7 @@ static void check_symbols(struct symbol_list *list)
expand_symbol(sym);
ep = linearize_symbol(sym);
- if (ep) {
+ if (ep && ep->entry) {
if (dbg_entry)
show_entry(ep);