You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ion_reader_next indicates the end of a container by setting the passed ION_TYPE reference to tid_EOF, regardless of whether the end of that container was expected (and the container valid) or the stream incomplete.
When a caller attempts to step out of the container, the ION_ASSERT condition in _ion_reader_binary_step_out is true. Depending on whether ion-c is built in debug or release this may result in a failed assertion or an infinite loop.
It seems totally reasonable for me as a user that I should be able to try to step out of the container in this case, and reliably get an error in the case of premature stream end.
This change replaces what is an assertion failure with a returned
error when the user attempts to step out of an Ion Container that
was not completed before the stream ended.
The issue is causing ion-python loads to hang for this case.
GH #355
* Replace Assertion Failure with Error for Premature Container Ends
This change replaces what is an assertion failure with a returned
error when the user attempts to step out of an Ion Container that
was not completed before the stream ended.
The issue is causing ion-python loads to hang for this case.
GH #355
* Add check for valid state in reader next as well
I realized the text reader also throws an error when the user tries
to get the next value from within the container. That seems right
to me as well, so I added a check there and then a test to prove
consistency.
ion_reader_next
indicates the end of a container by setting the passedION_TYPE
reference totid_EOF
, regardless of whether the end of that container was expected (and the container valid) or the stream incomplete.When a caller attempts to step out of the container, the
ION_ASSERT
condition in_ion_reader_binary_step_out
is true. Depending on whether ion-c is built in debug or release this may result in a failed assertion or an infinite loop.It seems totally reasonable for me as a user that I should be able to try to step out of the container in this case, and reliably get an error in the case of premature stream end.
This is the apparent cause of amazon-ion/ion-python#398
The text was updated successfully, but these errors were encountered: