Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on decoding partial YAML #1

Open
kkebo opened this issue May 5, 2023 · 0 comments · May be fixed by #2
Open

Crashes on decoding partial YAML #1

kkebo opened this issue May 5, 2023 · 0 comments · May be fixed by #2

Comments

@kkebo
Copy link

kkebo commented May 5, 2023

How to reproduce:

let obj = try UniYAML.decode("a: ")

Expected result:

obj == nil

Actual result:

It crashes.

ID:           F499B549-9FB7-45AC-A277-B33766C91B89
Process:      DevToys [12392]
Identifier:   DevToys
Date/Time:    2023-05-05 05:53:23 +0000

Application Specific Information:
dyld: dyld config: DYLD_INSERT_LIBRARIES=/System/Library/PrivateFrameworks/PreviewsInjection.framework/PreviewsInjection
libswiftCore.dylib: Swift/StringIndexValidation.swift:121: Fatal error: String index is out of bounds

Thread:
0      libswiftCore.dylib                               closure #1 in closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:)
1      libswiftCore.dylib                               closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:)
2      libswiftCore.dylib                               _assertionFailure(_:_:file:line:flags:)
3      libswiftCore.dylib                               _StringGuts.validateScalarIndex(_:)
4      libswiftCore.dylib                               String.subscript.getter
5      DevToys                                          static UniYAML.parseToken(_:index:to:honorDash:inFlow:) /var/mobile/Containers/Data/Application/8912EB0F-0FC1-48F3-A8F9-CA2C7872F283/Library/Caches/com.apple.Playgrounds/DerivedData/DevToys-hlchpxicvjmykxgvzllxejrkiuqt/SwiftPM/scratch/checkouts/swift-log/Sources/Logging/Logging.swift:544
6      DevToys                                          static UniYAML.decode(_:) /var/mobile/Containers/Data/Application/8912EB0F-0FC1-48F3-A8F9-CA2C7872F283/Library/Caches/com.apple.Playgrounds/DerivedData/DevToys-hlchpxicvjmykxgvzllxejrkiuqt/SwiftPM/scratch/checkouts/swift-log/Sources/Logging/Locks.swift:0
kkebo added a commit to kkebo/swift-uniyaml that referenced this issue May 5, 2023
@kkebo kkebo linked a pull request May 5, 2023 that will close this issue
kkebo added a commit to kkebo/swift-uniyaml that referenced this issue May 5, 2023
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 a pull request may close this issue.

1 participant