db: handle returning block statements better
commit24733bd015ae0f220e8d960533ddb2d969418fee
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Oct 2017 12:08:05 +0000 (11 15:08 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Oct 2017 12:08:05 +0000 (11 15:08 +0300)
tree3bd898d8d389d927f52493c76b83666ab0f36ddb
parentc37c69b76375a472900ceda5f5811918cb4d5c28
db: handle returning block statements better

This is part of handling container_of() better.  Say you have code like:

return container_of(...);

The container_of() macro is one of those block statements like so:

#define container_of(ptr, type, member) ({              \
void *__mptr = (void *)(ptr); \
((type *)(__mptr - offsetof(type, member))); })

Normally when we handle that sort of thing, then we just consider the
last statement in the block statement.  And we should do the same thing
with return statements as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_db.c