Uploaded image for project: 'Swift'
  1. Swift
  2. SR-8706

Fix up parseDependencyFile to not crash on invalid YAML

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kushaj Kushajveer Singh
                Reporter:
                jrose Jordan Rose
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: