[llvm-bugs] [Bug 43462] New: Null pointer dereference warning inside PrintActions1

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 26 06:19:08 PDT 2019


            Bug ID: 43462
           Summary: Null pointer dereference warning inside PrintActions1
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk


Clang static analyzer is warning that we might be dereferencing a null pointer
to 'const ToolChain *TC' inside PrintActions1:


const ToolChain *TC;
if (TC)
  os << A->getOffloadingKindPrefix();
  os << "host";
os << " (";
os << TC->getTriple().normalize();

Code coverage indicates that the !TC path is never taken in testsuite, and a
quick inspection of doOnHostDependence and doOnEachDeviceDependence suggests we
shouldn't ever call it with TC == null, so maybe we should just assert that TC
is not null and remove the 'host' case?


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190926/f56b6ac8/attachment-0001.html>

More information about the llvm-bugs mailing list