[PATCH] D36138: [ELF] - Don't segfault when accessing location counter inside MEMORY command.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 06:12:16 PDT 2017


grimar added a comment.

In https://reviews.llvm.org/D36138#827316, @ruiu wrote:

> `CurAddressState` is used at various places in this file, and it doesn't seem like this is the only place that you can trigger a null pointer access. Are you sure that this fix is enough?


I am trying to fix issues I know about + look around for similar cases. This issue happened because CurAddressState was accessed before processing sections commands,
where it is assigned initially. At this moment I do not know about other similar cases which can trigger null pointer access to CurAddressState. 
Though it is probably can be possible, do you know any ?

I think we can go step by step probably and see if we need some generic helper or something if see another cases with CurAddressState.


https://reviews.llvm.org/D36138





More information about the llvm-commits mailing list