This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj] Fixing opening empty yaml files.
ClosedPublic

Authored by plotfi on Mar 28 2019, 2:58 PM.

Details

Summary

Essentially echo "" | yaml2obj crashes. This patch attempts to trim whitespace and determine if the yaml string in the file is empty or not.

Diff Detail

Repository
rL LLVM

Event Timeline

plotfi created this revision.Mar 28 2019, 2:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2019, 2:58 PM
compnerd accepted this revision.Mar 28 2019, 3:02 PM

Please check the error message is printed in the case the YAML is empty.

This revision is now accepted and ready to land.Mar 28 2019, 3:02 PM
plotfi updated this revision to Diff 192731.Mar 28 2019, 3:47 PM
This revision was automatically updated to reflect the committed changes.
pcc added a subscriber: pcc.Mar 28 2019, 4:00 PM

Essentially echo "" | yaml2obj crashes.

Why is this the right place for the fix then? Isn't it a bug in yaml::Input?