[PATCH] D147931: [ARM] Fix null pointer dereferences in ARMMachObjectWriter::recordRelocation()
Alexey Vishnyakov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 13 02:07:54 PDT 2023
SweetVishnya updated this revision to Diff 513118.
SweetVishnya added a comment.
Add !A check as @dmgreen suggested
This will suppress static analyzer warnings.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147931/new/
https://reviews.llvm.org/D147931
Files:
llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
Index: llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
===================================================================
--- llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
+++ llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
@@ -428,8 +428,9 @@
unsigned Type = 0;
const MCSymbol *RelSymbol = nullptr;
- if (Target.isAbsolute()) { // constant
- // FIXME!
+ if (!A) { // constant
+ // FIXME! This is Target.isAbsolute() case. 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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147931.513118.patch
Type: text/x-patch
Size: 701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230413/cfc7014e/attachment.bin>
More information about the llvm-commits
mailing list