interrogatedb: fix library name setting for typedefs

Typedefs are evidently always considered "fully defined", so we need to add another condition to the database merging code to prefer the type that is marked "global" when merging two types.
This commit is contained in:
rdb 2018-02-27 19:33:18 +01:00
parent fa231664bd
commit 162b86c6d9

View File

@ -112,14 +112,16 @@ operator = (const InterrogateType &copy) {
/**
* Combines type with the other similar definition. If one type is "fully
* defined" and the other one isn't, the fully-defined type wins.
* defined" and the other one isn't, the fully-defined type wins. If both
* types are fully defined, whichever type is marked "global" wins.
*/
void InterrogateType::
merge_with(const InterrogateType &other) {
// The only thing we care about copying from the non-fully-defined type
// right now is the global flag.
if (is_fully_defined()) {
if (is_fully_defined() &&
(!other.is_fully_defined() || (other._flags & F_global) == 0)) {
// We win.
_flags |= (other._flags & F_global);