[PATCH] D33574: PPC: Verify that branch fixups fit within the range.

Kit Barton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 10:35:24 PDT 2017


kbarton added inline comments.


================
Comment at: lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp:44
   case PPC::fixup_ppc_brcond14abs:
+    assert(Value <= 0xffff && "Cond branch absolute target overflow.");
     return Value & 0xfffc;
----------------
Why an assert here vs llvm_unreachable?
If we build without asserts, this won't fail and we'll most likely generate incorrect code.


https://reviews.llvm.org/D33574





More information about the llvm-commits mailing list