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

[SR-8706] Fix up parseDependencyFile to not crash on invalid YAML #51218

belkadan opened this issue Sep 5, 2018 · 1 comment

[SR-8706] Fix up parseDependencyFile to not crash on invalid YAML #51218

belkadan opened this issue Sep 5, 2018 · 1 comment


Copy link

@belkadan belkadan commented Sep 5, 2018

Previous ID SR-8706
Radar rdar://problem/25095498
Original Reporter @belkadan
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Driver, StarterBug
Assignee kushaj (JIRA)
Priority Medium

md5: dfcb979cb9d3bef3f8ec210cda836a79

relates to:

  • SR-8707 Write out swiftdeps files atomically

Issue Description:

LLVM's YAML parser returns null when it encounters a malformed node, but parseDependencyFile (in DependencyFile.cpp) isn't checking for this. We should fix this so that a malformed "swiftdeps" file doesn't result in crashes.

This applies to all uses of the LLVM YAML parser, really:

  • OutputFileMap::parse in OutputFileMap.cpp

  • populateOutOfDateMap in Driver.cpp

  • YamlGroupInputParser in Serialization.cpp already seems to be doing this correctly.

  • APIDiffItemStore and SILPassPipelinePlan::getPassPipelineFromFile don't really have to care about malformed input.

Tests for these APIs can go into the unittests/Driver/ folder.

Copy link
Contributor Author

@belkadan belkadan commented Jul 27, 2019

kushaj (JIRA User), are you still working on this?

(I'm checking in on all the StarterBugs that haven't been touched in over a month; it's totally fine if you just haven't had time but still want to keep it.)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant