Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ion_catalog_find_symbol_table doesn't find anything #267

Merged
merged 1 commit into from
Dec 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions ionc/ion_catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ iERR ion_catalog_find_symbol_table(hCATALOG hcatalog, iSTRING name, long version
iERR _ion_catalog_find_symbol_table_helper(ION_CATALOG *pcatalog, ION_STRING *name, int32_t version, ION_SYMBOL_TABLE **p_psymtab)
{
iENTER;
ION_SYMBOL_TABLE *symtab;
ION_SYMBOL_TABLE **ppsymtab, *psymtab, *found = NULL;
ION_COLLECTION_CURSOR symtab_cursor;

ASSERT(pcatalog != NULL);
Expand All @@ -195,20 +195,24 @@ iERR _ion_catalog_find_symbol_table_helper(ION_CATALOG *pcatalog, ION_STRING *na
if (version == pcatalog->system_symbol_table->version
&& ION_STRING_EQUALS(name, &pcatalog->system_symbol_table->name)
) {
symtab = pcatalog->system_symbol_table;
found = pcatalog->system_symbol_table;
}
else {
ION_COLLECTION_OPEN(&pcatalog->table_list, symtab_cursor);
for (;;) {
ION_COLLECTION_NEXT(symtab_cursor, symtab);
if (!symtab) break;
if (symtab->version != version) continue;
if (ION_STRING_EQUALS(name, &symtab->name)) break;
ION_COLLECTION_NEXT(symtab_cursor, ppsymtab);
if (!ppsymtab) break;
psymtab = *ppsymtab;
if (psymtab->version != version) continue;
if (ION_STRING_EQUALS(name, &psymtab->name)) {
found = psymtab;
break;
}
}
ION_COLLECTION_CLOSE(symtab_cursor);
}

*p_psymtab = symtab;
*p_psymtab = found;
SUCCEED();

iRETURN;
Expand Down