[PATCH] D28851: [Assembler] Fix crash when assembling .quad for AArch32.

Chad Rosier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 07:14:00 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292373: [Assembler] Fix crash when assembling .quad for AArch32. (authored by mcrosier).

Changed prior to commit:
  https://reviews.llvm.org/D28851?vs=84813&id=84831#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28851

Files:
  llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
  llvm/trunk/test/MC/ARM/quad-relocation.s


Index: llvm/trunk/test/MC/ARM/quad-relocation.s
===================================================================
--- llvm/trunk/test/MC/ARM/quad-relocation.s
+++ llvm/trunk/test/MC/ARM/quad-relocation.s
@@ -0,0 +1,9 @@
+@ RUN: not llvm-mc -triple arm-arm-none-eabi -filetype obj < %s -o /dev/null 2>&1 | FileCheck %s
+
+	.align 3
+symbol:
+  .quad(symbol)
+
+@ CHECK: error: bad relocation fixup type
+@ CHECK-NEXT:   .quad(symbol)
+@ CHECK-NEXT:        ^
Index: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -363,7 +363,8 @@
   unsigned Kind = Fixup.getKind();
   switch (Kind) {
   default:
-    llvm_unreachable("Unknown fixup kind!");
+    if (Ctx) Ctx->reportError(Fixup.getLoc(), "bad relocation fixup type");
+    return 0;
   case FK_Data_1:
   case FK_Data_2:
   case FK_Data_4:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28851.84831.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170118/2e182089/attachment.bin>


More information about the llvm-commits mailing list