aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-04-10 15:25:22 +0200
committerJosh Triplett <josh@freedesktop.org>2008-04-21 11:08:50 -0700
commitc3903563ac88d18a726aef47220573b383d697d1 (patch)
tree04272e882b60665f7306cbf12648a4b56e5f3fcf /symbol.h
parentsparse test suite: add test mixing __context__ and __attribute__((context(...))) (diff)
downloadsparse-c3903563ac88d18a726aef47220573b383d697d1.tar.gz
sparse-c3903563ac88d18a726aef47220573b383d697d1.tar.bz2
sparse-c3903563ac88d18a726aef47220573b383d697d1.zip
sparse: simple conditional context tracking
This patch enables a very simple form of conditional context tracking, namely something like if (spin_trylock(...)) { [...] spin_unlock(...); } Note that __ret = spin_trylock(...); if (__ret) { [...] spin_unlock(...); } does /not/ work since that would require tracking the variable and doing extra checks to ensure the variable isn't globally accessible or similar which could lead to race conditions. To declare a trylock, one uses: int spin_trylock(...) __attribute__((conditional_context(spinlock,0,1,0))) {...} Note that doing this currently excludes that function itself from context checking completely. Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'symbol.h')
-rw-r--r--symbol.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/symbol.h b/symbol.h
index 19beb76..50fb86a 100644
--- a/symbol.h
+++ b/symbol.h
@@ -71,7 +71,7 @@ enum keyword {
struct context {
struct expression *context;
- unsigned int in, out;
+ unsigned int in, out, out_false;
int exact;
};