Index: llvm/include/llvm/Option/ArgList.h =================================================================== --- llvm/include/llvm/Option/ArgList.h +++ llvm/include/llvm/Option/ArgList.h @@ -419,11 +419,13 @@ NumInputArgStrings(RHS.NumInputArgStrings) {} InputArgList &operator=(InputArgList &&RHS) { - releaseMemory(); - ArgList::operator=(std::move(RHS)); - ArgStrings = std::move(RHS.ArgStrings); - SynthesizedStrings = std::move(RHS.SynthesizedStrings); - NumInputArgStrings = RHS.NumInputArgStrings; + if (this != &RHS) { + releaseMemory(); + ArgList::operator=(std::move(RHS)); + ArgStrings = std::move(RHS.ArgStrings); + SynthesizedStrings = std::move(RHS.SynthesizedStrings); + NumInputArgStrings = RHS.NumInputArgStrings; + } return *this; }