[ARM] ARMMachObjectWriter::recordRelocation: reduce strength on a condition
authorAlexey Vishnyakov <vishnya@ispras.ru>
Tue, 9 May 2023 21:40:43 +0000 (14:40 -0700)
committerFangrui Song <i@maskray.me>
Tue, 9 May 2023 21:40:43 +0000 (14:40 -0700)
Reviewed By: MaskRay, dmgreen

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

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

index 6f81205..4a41fce 100644 (file)
@@ -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 {