Fix a thinko in the iteration over StructuredDataPlugin Create functions.

The code was grabbing the first plugin, and then never getting
another one.

<rdar://problem/39779438>

llvm-svn: 331012
This commit is contained in:
Jim Ingham 2018-04-27 01:57:40 +00:00
parent 1ae1febfde
commit 93979f67f8
1 changed files with 8 additions and 3 deletions

View File

@ -6177,11 +6177,16 @@ void Process::MapSupportedStructuredDataPlugins(
// For each StructuredDataPlugin, if the plugin handles any of the // For each StructuredDataPlugin, if the plugin handles any of the
// types in the supported_type_names, map that type name to that plugin. // types in the supported_type_names, map that type name to that plugin.
uint32_t plugin_index = 0; // Stop when we've consumed all the type names.
for (auto create_instance = // FIXME: should we return an error if there are type names nobody
// supports?
for (uint32_t plugin_index = 0; !const_type_names.empty(); plugin_index++) {
auto create_instance =
PluginManager::GetStructuredDataPluginCreateCallbackAtIndex( PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(
plugin_index); plugin_index);
create_instance && !const_type_names.empty(); ++plugin_index) { if (!create_instance)
break;
// Create the plugin. // Create the plugin.
StructuredDataPluginSP plugin_sp = (*create_instance)(*this); StructuredDataPluginSP plugin_sp = (*create_instance)(*this);
if (!plugin_sp) { if (!plugin_sp) {