Skip to content

Commit

Permalink
Fix crash on macOS (dresden-elektronik#7817)
Browse files Browse the repository at this point in the history
There are two bugs in one missing line.
After a new DDF is loaded during pairing the search must start from beginning of all loaded DDFs.
The actual crash happens when calling std::find_if with two end() iterators, but surprisingly only with Apple Clang, not with GCC on other platforms.

Issue: dresden-elektronik#7698
  • Loading branch information
manup committed Jun 19, 2024
1 parent 96790dd commit 6f307e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions device_descriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,6 @@ const DeviceDescription &DeviceDescriptions::get(const Resource *resource, DDF_M

if (modelidAtomIndex == 0 || mfnameAtomIndex == 0)
{
U_ASSERT(modelidItem->toString().isEmpty());
U_ASSERT(mfnameItem->toString().isEmpty());
return d->invalidDescription; // happens when called from legacy init code addLightNode() etc.
}

Expand Down Expand Up @@ -1121,6 +1119,7 @@ const DeviceDescription &DeviceDescriptions::get(const Resource *resource, DDF_M
// nothing found, try to load further DDFs
if (loadDDFAndBundlesFromDisc(resource))
{
i = d->descriptions.begin();
continue; // found DDFs or bundles, try again
}
break;
Expand Down

0 comments on commit 6f307e6

Please sign in to comment.