[PATCH] D34345: [LLD][ELF] Extract temporary state used in assignAddresses()

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 16:19:06 PDT 2017


mehdi_amini added inline comments.


================
Comment at: lld/trunk/ELF/LinkerScript.cpp:377
+  auto State = make_unique<AddressState>(Opt);
+  CurAddressState = State.get();
+  CurAddressState->OutSec = Aether;
----------------
Coverity flags this as suspicious (and I agree):

```
>>>     CID 1377401:  Memory - illegal accesses  (WRAPPER_ESCAPE)
>>>     The internal representation of local "State" escapes into "this->CurAddressState", but is destroyed when it exits scope.
```

If this is intended, please add a comment.


Repository:
  rL LLVM

https://reviews.llvm.org/D34345





More information about the llvm-commits mailing list