Change the way container type information is stored in stack #666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #664 :
Description of changes:
This PR is to resolve the error
Skipped over end of source
when traversing input Ion data with only doingnext()
operation.Cause of Issue:
The reason that this error occurred was because
IonParserBinaryRaw
was using a value(ts
) created by storing bothlen
andtype
field of container type into one. This value is then pushed inside a stack(_ts
) which is used to store information of a container when steping in and the same value would be popped on the step out side to get back the container information.Here, the
len
value that is encoded byencode_type_stack
if exceeds 27 bits, it won't be able to get back to its correctlen
value when decoded usingdecode_type_stack_len
. This gives an incorrectlen
value and eventually it sets thelimit
value ofIonSpan
to be incorrect and hence throws the errorSkipped over end of source
.Solution to the Issue:
As a solution to this issue I have used a
stackPointer
Object which haslen
andtype
variables. This stackPointer would be added to the stack_ts
and can be popped out to get back the correctlen
andtype
information.Test:
Tested this using a large enough file that could give a value greater than 27 bits for
len
.