[llvm] 9a564a6 - [ARM] ARMMachObjectWriter::recordRelocation: reduce strength on a condition

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 14:40:48 PDT 2023


Author: Alexey Vishnyakov
Date: 2023-05-09T14:40:43-07:00
New Revision: 9a564a61a281021a67ce05d55f1cd3d008a0838b

URL: https://github.com/llvm/llvm-project/commit/9a564a61a281021a67ce05d55f1cd3d008a0838b
DIFF: https://github.com/llvm/llvm-project/commit/9a564a61a281021a67ce05d55f1cd3d008a0838b.diff

LOG: [ARM] ARMMachObjectWriter::recordRelocation: reduce strength on a condition

Reviewed By: MaskRay, dmgreen

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

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
index 6f81205f7a32e..4a41fce711f3f 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
@@ -427,8 +427,10 @@ void ARMMachObjectWriter::recordRelocation(MachObjectWriter *Writer,
   unsigned Type = 0;
   const MCSymbol *RelSymbol = nullptr;
 
-  if (Target.isAbsolute()) { // constant
-    // FIXME!
+  if (!A) { // constant
+    // FIXME! This is Target.isAbsolute() case as we check SymB above. We check
+    // !A to ensure that null pointer isn't dereferenced and suppress static
+    // analyzer warnings.
     report_fatal_error("FIXME: relocations to absolute targets "
                        "not yet implemented");
   } else {


        


More information about the llvm-commits mailing list