Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src-python/amazon/ion/reader_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ def _rslice(data, rem, size):


def _int_factory(sign, data):
if sign < 0 and not any(data):
raise IonException('Negative zero is not a valid int.')

def parse_int():
value = 0
length = len(data)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_reader_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def _prepend_ivm(params):
(b'\xe4\x81\x84\xb2\x21\x01', 'ANNOT LENGTH TOO SHORT - CONTAINER'),
# The annotation wrapper declares 3 octets, but the subfields (including an int) take up four.
(b'\xe3\x81\x84\x21\x01', 'ANNOT LENGTH TOO SHORT - SCALAR'),
# A negative int with a magnitude of zero (negative zero) is illegal.
(b'\x31\x00', 'NEGATIVE INT ZERO'),
# TODO: annnotated nop is a fail

# TODO: value within container is longer than container.
Expand Down
1 change: 0 additions & 1 deletion tests/test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def _open(file):
_bad_file(u'localSymbolTableWithMultipleImportsFields.10n'), # TODO amazon-ion/ion-python#118
_bad_file(u'localSymbolTableWithMultipleSymbolsAndImportsFields.10n'), # TODO amazon-ion/ion-python#118
_bad_file(u'localSymbolTableWithMultipleSymbolsFields.10n'), # TODO amazon-ion/ion-python#118
_bad_file(u'negativeIntZero.10n'), # TODO amazon-ion/ion-python#119
_equivs_file(u'timestampSuperfluousOffset.10n') # TODO amazon-ion/ion-python#121
)

Expand Down