Skip to content

Conversation

desaikd
Copy link
Contributor

@desaikd desaikd commented Dec 22, 2020

Issue #664 :

Description of changes:
This PR is to resolve the error Skipped over end of source when traversing input Ion data with only doing next() operation.

Cause of Issue:
The reason that this error occurred was because IonParserBinaryRaw was using a value(ts) created by storing both len and type 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 by encode_type_stack if exceeds 27 bits, it won't be able to get back to its correct len value when decoded using decode_type_stack_len. This gives an incorrect len value and eventually it sets the limit value of IonSpan to be incorrect and hence throws the error Skipped over end of source.

Solution to the Issue:
As a solution to this issue I have used a stackPointer Object which has len and type variables. This stackPointer would be added to the stack _ts and can be popped out to get back the correct len and type information.

Test:
Tested this using a large enough file that could give a value greater than 27 bits for len.

Copy link
Contributor

@zslayton zslayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some superficial comments below.

@desaikd desaikd merged commit cf83b05 into amazon-ion:master Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants