https://bugs.llvm.org/show_bug.cgi?id=41513
Bug ID: 41513
Summary: [yaml2obj] will crash when reading a yaml file which
only contains comments.
Product: new-bugs
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: higuox...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
yaml2obj will crash if it reads a yaml file only contains comments. e.g.
```
$ cat empty.yaml
# some comment
$ yaml2obj empty.yaml
Stack dump:
0. Program arguments:
/Users/cat/Workspace/llvm/llvm-tools-lld-build/bin/yaml2obj empty.yaml
0 yaml2obj 0x0000000106d96138
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 yaml2obj 0x0000000106d952b5 llvm::sys::RunSignalHandlers() +
85
2 yaml2obj 0x0000000106d967a8 SignalHandler(int) + 264
3 libsystem_platform.dylib 0x00007fffbf796b3a _sigtramp + 26
4 libsystem_platform.dylib 0x00007fff58f65060 _sigtramp + 2575099200
5 yaml2obj 0x0000000106d4d1fd
llvm::yaml::MappingTraits<llvm::yaml::YamlObjectFile>::mapping(llvm::yaml::IO&,
llvm::yaml::YamlObjectFile&) + 141
6 yaml2obj 0x0000000106c9cc0c main + 892
7 libdyld.dylib 0x00007fffbf587235 start + 1
8 libdyld.dylib 0x0000000000000002 start + 1084722638
[1] 2847 segmentation fault
~/Workspace/llvm/llvm-tools-lld-build/bin/yaml2obj empty.yaml
```
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs