db: give up handling function pointers if there are too many returns
commit02ec74e6b53764e87b64436c4ae117d9b2813b5e
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 19 Jan 2017 13:09:52 +0000 (19 16:09 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 19 Jan 2017 13:09:52 +0000 (19 16:09 +0300)
treeca55ea1b37198ea5199331a01861c5746dbcc966
parentc5019c7a0d437d23585f6f6ec39515e190b136fa
db: give up handling function pointers if there are too many returns

Say you have a function pointer:

my_struct->frob();

But there are 100 different places which assign a different function to
the frob pointer.  And say that each of these implementations has 3 return
statements.  I means that you're trying to merge 300 return strees
together.  It's not normal for individual functions to have 300 return
statements and actually if that were the case, we already have a bail out
clause for individual functions.

Then you have a few files where all they do is call one function pointer
after another:

my_struct->frob();
my_struct->frob_some_more();
my_struct->frob_again();

So it can become really slow.

This only became an issue recently when we fixed the ordering.  Before that
all the returns were mangled together so we never saw the slowdown.

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