Reject top-level single-value decoding#331
Merged
Merged
Conversation
|
�[33mWarning: running with the Swift runtime interposer on Linux to avoid the Swift 6.3 runtime hook crash. See https://github.com/ordo-one/benchmark/issues/349�[0m Comparing results between 'main' and 'pull_request'TOMLDecoderBenchmarksDecode toml.io example metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
Parse toml.io example metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
decode canada.toml metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
decode twitter.toml metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
parse GitHub events archive metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
parse canada.toml metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
parse twitter.toml metricsTime (wall clock): results within specified thresholds, fold down for details.
Retains: results within specified thresholds, fold down for details.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DecodingError.typeMismatchinstead of attempting to unpack an uninitialized token.Int.Root cause
A top-level
TOMLDecoderwraps a keyedTOMLTableand leaves its scalar token at the empty sentinel. When a scalarDecodabletype requested a single-value container, the decoder returned itself and integer decoding indexed that empty token range, producing aSIGTRAPduring decoder-fuzzer corpus initialization.Impact
Wrong-shape top-level decoding now fails normally with
DecodingErrorinstead of terminating the process. This allows the decoder fuzz target to load valid table-shaped corpus entries and continue fuzzing.Validation
swift test— 750 tests passed.swift test --filter TOMLDecoderTests.topLevelTableCannotDecodeAsSingleValue