]> granicus.if.org Git - clang/commitdiff
Switch to consumeError(), since this can crash otherwise.
authorStephen Hines <srhines@google.com>
Tue, 15 Aug 2017 21:20:41 +0000 (21:20 +0000)
committerStephen Hines <srhines@google.com>
Tue, 15 Aug 2017 21:20:41 +0000 (21:20 +0000)
Summary:
If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled,
this will cause an issue with an unchecked Success. Switching to
consumeError() is the correct way to bypass the check.

Reviewers: llvm-commits, cfe-commits, arphaman

Reviewed By: arphaman

Subscribers: arphaman, klimek, pirama

Differential Revision: https://reviews.llvm.org/D36728

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310958 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Tooling/Core/Replacement.cpp

index e194b59a6e2b14df3f1fd076dcef342f9950178b..6d4f3a3401425691dc639c61fb6db0d81ddadd9f 100644 (file)
@@ -503,7 +503,7 @@ calculateRangesAfterReplacements(const Replacements &Replaces,
                                             std::string(R.getLength(), ' ')));
     assert(!Err &&
            "Replacements must not conflict since ranges have been merged.");
-    (void)Err;
+    llvm::consumeError(std::move(Err));
   }
   return FakeReplaces.merge(Replaces).getAffectedRanges();
 }