mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-08 12:21:04 +00:00
[obj2yaml] Fix ASAN bot failure
I was leaking out of a unique_ptr, should have just kept it in the unique_ptr. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/12738/steps/check-llvm%20asan/logs/stdio llvm-svn: 269336
This commit is contained in:
parent
3f19f1ad66
commit
635b6b12b0
@ -21,10 +21,10 @@ class MachODumper {
|
||||
|
||||
public:
|
||||
MachODumper(const object::MachOObjectFile &O) : Obj(O) {}
|
||||
Expected<MachOYAML::Object *> dump();
|
||||
Expected<std::unique_ptr<MachOYAML::Object> > dump();
|
||||
};
|
||||
|
||||
Expected<MachOYAML::Object *> MachODumper::dump() {
|
||||
Expected<std::unique_ptr<MachOYAML::Object> > MachODumper::dump() {
|
||||
auto Y = make_unique<MachOYAML::Object>();
|
||||
Y->Header.magic = Obj.getHeader().magic;
|
||||
Y->Header.cputype = Obj.getHeader().cputype;
|
||||
@ -34,12 +34,12 @@ Expected<MachOYAML::Object *> MachODumper::dump() {
|
||||
Y->Header.sizeofcmds = Obj.getHeader().sizeofcmds;
|
||||
Y->Header.flags = Obj.getHeader().flags;
|
||||
|
||||
return Y.release();
|
||||
return std::move(Y);
|
||||
}
|
||||
|
||||
Error macho2yaml(raw_ostream &Out, const object::MachOObjectFile &Obj) {
|
||||
MachODumper Dumper(Obj);
|
||||
Expected<MachOYAML::Object *> YAML = Dumper.dump();
|
||||
Expected<std::unique_ptr<MachOYAML::Object> > YAML = Dumper.dump();
|
||||
if (!YAML)
|
||||
return YAML.takeError();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user