[PATCH] D36728: Switch to consumeError(), since this can crash otherwise.

Stephen Hines via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 21:01:00 PDT 2017


srhines created this revision.
Herald added a subscriber: klimek.

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.


https://reviews.llvm.org/D36728

Files:
  lib/Tooling/Core/Replacement.cpp


Index: lib/Tooling/Core/Replacement.cpp
===================================================================
--- lib/Tooling/Core/Replacement.cpp
+++ lib/Tooling/Core/Replacement.cpp
@@ -503,7 +503,7 @@
                                             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();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36728.111128.patch
Type: text/x-patch
Size: 505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170815/76fe05f6/attachment.bin>


More information about the llvm-commits mailing list