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

Fix the hacky solution for adjusting FlexSym system SIDs #946

Open
popematt opened this issue Sep 27, 2024 · 0 comments
Open

Fix the hacky solution for adjusting FlexSym system SIDs #946

popematt opened this issue Sep 27, 2024 · 0 comments
Labels

Comments

@popematt
Copy link
Contributor

popematt commented Sep 27, 2024

A hacky solution was introduced in #944. It works for now, but it will break if the Ion 1.1 system symbol table gets significantly larger.

// FIXME: This is a hack that works as long as our system symbol table doesn't grow to
// more than ~95 symbols. We need this hack because when we have to read the FixedInt,
// we don't know whether it's a tagless FlexSym or a Regular value.
// Possible solutions include:
// * changing the spec so that FlexSym System SIDs line up with the regular System SIDs
// * Introducing a dummy IonTypeID that indicates that we need to add the bias
// * Update IonCursorBinary.slowSkipFlexSym_1_1() to put the id into valueMarker.endIndex,
// though that seems to have its own problems.
if (id >= FLEX_SYM_SYSTEM_SYMBOL_OFFSET) {
id = id - FLEX_SYM_SYSTEM_SYMBOL_OFFSET;
}

Part of the fix may involve solving this problem:

// FIXME: See if we can set the SID in the endIndex here without causing the slow reader to get confused
// about where the end of the value is for tagless symbols.
// I.e. use setSystemSymbolMarker(markerToSet, (byte)(specialByte - FLEX_SYM_SYSTEM_SYMBOL_OFFSET));
markerToSet.typeId = SYSTEM_SYMBOL_VALUE;
markerToSet.startIndex = peekIndex - 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant