Bugs were found by Svace static analysis tool. A can be a null pointer.
It is checked in some places. However, there are still some missing
checks.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks sweetvishnya, this looks worthwhile. Do you have the link for a github issue for this?
I'm not sure A can be null here. Either getSymB will be true (handled above) or isAbsolute will be true. Else A should have a value, if Im reading it correctly.
The bug was reported by a static analyzer because A is checked for null in line 419. But I am not really familiar with the code here.
If you wanted to add an assert or change the condition of the if (Target.isAbsolute()) to if (!A) then I wouldn't be against it, providing there was a comment to explain that meant isAbsolute. But yes, this looks like a false positive.
Thanks. One minor suggestion but otherwise Sounds OK to me.
llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp | ||
---|---|---|
433 | Can you add This is Target.isAbsolute() case as we check SymB above. .. |
Can you add This is Target.isAbsolute() case as we check SymB above. ..