apple / swift-system

Low-level system calls and types for Swift
Apache License 2.0
1.18k stars 102 forks source link

Ensure that FilePath and SystemString's invariants are enforced when … #189

Closed stephentyrone closed 3 months ago

stephentyrone commented 3 months ago

Decoding these generally takes untrusted input, and corrupted data should be diagnosed with a throw instead of a later crash; the synthesized Decodable conformance has no means to do that for us, so we have to roll our own. It's likely that a more-thorough reworking of these is appropriate, but in the short term we can and should throw an error for the cases that our existing invariants can detect.

stephentyrone commented 3 months ago

@swift-ci test