Correct unique_ptr passing in MCObjectDisassembler::setFallbackRegion

Rather than passing by lvalue reference, pass by value to ensure that
the caller provides an rvalue (and use move assignment, rather than
release+reset, to assign to the member variable)

llvm-svn: 216916
This commit is contained in:
David Blaikie 2014-09-02 17:29:51 +00:00
parent 1b0713ce09
commit 14f7301392
1 changed files with 2 additions and 2 deletions

View File

@ -66,8 +66,8 @@ public:
/// \brief Set the region on which to fallback if disassembly was requested
/// somewhere not accessible in the object file.
/// This is used for dynamic disassembly (see RawMemoryObject).
void setFallbackRegion(std::unique_ptr<MemoryObject> &Region) {
FallbackRegion.reset(Region.release());
void setFallbackRegion(std::unique_ptr<MemoryObject> Region) {
FallbackRegion = std::move(Region);
}
/// \brief Set the symbolizer to use to get information on external functions.