mozilla/dxr — pull request #37 by abbeyj (2012-11-21 17:41:54+00:00)
Title: Fix for "Jump to definition" sometimes jumping to a declaration instead.

Now "function" is emitted to the .csv only for function definitions, not
declarations. Declarations will get a "decldef" if a definition is
available elsewhere in the translation unit.

Having multiple "function" entries for a single function would cause
the UNION in indexer.py:update_refs to return more than one row
(one from functions and one from decldef). If the one from decldef
won then "Jump to definition" worked. If the one from functions won
then you'd be taken to the declaration instead. SQLite seems to
break this tie based on the numeric value of the ID so the behavior
was somewhat nondeterministic when minor changes were made to the
source code.