[PATCH] D33842: CodeGen: Fix address space of global variable

Mehdi AMINI via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 16:14:09 PDT 2017


mehdi_amini added inline comments.


================
Comment at: cfe/trunk/lib/CodeGen/CodeGenModule.cpp:3759
+  unsigned AddrSpace =
+      VD ? GetGlobalVarAddressSpace(VD) : MaterializedType.getAddressSpace();
+  auto TargetAS = getContext().getTargetAddressSpace(AddrSpace);
----------------
Coverity reports: 
```
>>>     CID 1377397:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "VD" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
```

Can you look into this?


Repository:
  rL LLVM

https://reviews.llvm.org/D33842





More information about the cfe-commits mailing list