aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-04-11 13:07:47 +0200
committerJosh Triplett <josh@freedesktop.org>2008-04-21 11:09:45 -0700
commitd8760c3341f858648b1e7091fdf24033d0669dc4 (patch)
tree47cc13d147546a1c93ff2a2fd35e19329177f469
parentc3903563ac88d18a726aef47220573b383d697d1 (diff)
downloadsparse-d8760c3341f858648b1e7091fdf24033d0669dc4.tar.gz
sparse-d8760c3341f858648b1e7091fdf24033d0669dc4.tar.xz
sparse-d8760c3341f858648b1e7091fdf24033d0669dc4.zip
inlined call bugfix & test
This patch fixes an oversight in my other patches, inlined calls weren't checked for context properly. Also adds a test case for this. Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
-rw-r--r--sparse.c1
-rw-r--r--validation/context-named.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/sparse.c b/sparse.c
index 2315038..fcd7487 100644
--- a/sparse.c
+++ b/sparse.c
@@ -137,6 +137,7 @@ static int check_bb_context(struct entrypoint *ep, struct basic_block *bb,
if (!insn->bb)
continue;
switch (insn->opcode) {
+ case OP_INLINED_CALL:
case OP_CALL:
if (!insn->func || !insn->func->sym || insn->func->type != PSEUDO_SYM)
break;
diff --git a/validation/context-named.c b/validation/context-named.c
index d5573f4..806d736 100644
--- a/validation/context-named.c
+++ b/validation/context-named.c
@@ -465,6 +465,17 @@ static void warn_exact_fn2(void)
r2();
}
+static inline void need_lock3(void) __attribute__((context(TEST,1,1)))
+{
+}
+
+static void warn_fn3(void)
+{
+ a2();
+ need_lock3();
+ r2();
+}
+
#define __acquire(x) __context__(x,1)
#define __release(x) __context__(x,-1)
@@ -513,5 +524,6 @@ context-named.c:434:14: warning: context problem in 'warn_fn' - function 'need_l
context-named.c:441:15: warning: context problem in 'warn_fn2' - function 'need_lock2' expected different context
context-named.c:456:20: warning: context problem in 'warn_exact_fn1' - function 'need_lock_exact' expected different context
context-named.c:464:20: warning: context problem in 'warn_exact_fn2' - function 'need_lock_exact' expected different context
+context-named.c:475:15: warning: context problem in 'warn_fn3' - function 'need_lock3' expected different context
* check-error-end
*/