#270 Find assignments gets confused with compressed database

closed-fixed
nobody
None
5
2012-06-15
2012-04-13
Bill Lash
No

Using the new "Find assignments to this symbol" I notice that there are several cases where, for example "p == NULL" gets detected as an assignment to p. (create a cscope.files with all of the .c and .h files in the cscope src directory, and run cscope there, and find assignments to p, and the first result shows the issue).

I was confused, because the code seemed to be checking for == and not including that as a valid match. After using a debugger for a while, I found that the issue occured when the second = was part of a digraph. I am attaching a patch that seems to fix the issue, but it is ugly. It could probably be made better by using a macro or function.

Discussion

  • Bill Lash
    Bill Lash
    2012-04-13

    patch for digraph find assignments issue

     
    Attachments
  • Bill Lash
    Bill Lash
    2012-04-14

    updated version of the patch

     
    Attachments
  • Bill Lash
    Bill Lash
    2012-04-14

    I added a second version of the patch. I noticed that when using an invered index, tind assignments to symbol didn't work. The code for doing the search using the inverted index doesn't run the results through the search for the assignment operators. I made a quick change so that if you are searching for assignments, you don't use the inverted index

     
  • Bill Lash
    Bill Lash
    2012-04-20

    • summary: Find assignments gets confused with digraphs --> Find assignments gets confused with compressed database
     
  • Bill Lash
    Bill Lash
    2012-04-20

    Changing the name to indicate that the issue exists with compressed databases (which are the default. If you use the -c option for an uncompressed database, the problem doesn't exist. However there is also an issue with inverted databases.

     
  • Neil Horman
    Neil Horman
    2012-06-15

    • status: open --> closed-fixed