[SR-8706] Fix up parseDependencyFile to not crash on invalid YAML #51218
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
good first issue
Good for newcomers
legacy driver
Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Additional Detail from JIRA
md5: dfcb979cb9d3bef3f8ec210cda836a79
relates to:
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.cpppopulateOutOfDateMap
in Driver.cppYamlGroupInputParser 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.
The text was updated successfully, but these errors were encountered: