git » libfiu » commit ea20786

libfiu: Include function boundaries

author Alberto Bertogli
2012-08-30 23:43:08 UTC
committer Alberto Bertogli
2012-09-02 23:02:35 UTC
parent 78f9899beb67502d9bd2e8345724ef2f6877122a

libfiu: Include function boundaries

When checking if the instruction pointer is within a given function
boundaries, we have to include the boundaries themselves too.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/fiu.c +2 -2

diff --git a/libfiu/fiu.c b/libfiu/fiu.c
index ff47cf3..01f0617 100644
--- a/libfiu/fiu.c
+++ b/libfiu/fiu.c
@@ -180,8 +180,8 @@ static int pc_in_func(struct pf_info *pf, void *pc)
 	/* We don't know if the platform allows us to know func_end,
 	 * so we use different methods depending on its availability. */
 	if (pf->minfo.stack.func_end) {
-		return (pc > pf->minfo.stack.func_start &&
-				pc < pf->minfo.stack.func_end);
+		return (pc >= pf->minfo.stack.func_start &&
+				pc <= pf->minfo.stack.func_end);
 	} else {
 		return pf->minfo.stack.func_start == get_func_start(pc);
 	}