Closed joskuijpers closed 3 years ago
Hmm no idea why it is failing. I removed the whitespace already...
@joskuijpers I pulled your commits and made a few additional updates to yours and merged it with PR https://github.com/SomeRandomiOSDev/CBORCoding/pull/18
When a Data input is used that has a slice started beyond 0, an exception was thrown because the parser tried to access index 0.
See for example https://stackoverflow.com/questions/54698947/swift-data-subdata-fails-with-exc-bad-instruction-code-exc-i386-invop-subcode for an explanation.
All that was needed to fix it was to start at
data.startIndex
and finishes beforedata.endIndex
. I also added a testcase that failed before my change and succeeds after my changes. The rest of the cases still run.