[Lldb-commits] [lldb] cd64273 - [lldb/ELF] Fix IDs of synthetic eh_frame symbols

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 22 05:31:30 PDT 2021


On 21/04/2021 22:13, Shafik Yaghmour wrote:
> Having side effects in the argument to a function call just feels like a bad idea in general even if it seems obviously correct here e.g.
> 
>    ++last_symbol_id,
> 
> Can’t we just do:
> 
>    uint64_t last_symbol_id =
>        num_symbols ? symbol_table->SymbolAtIndex(num_symbols - 1)->GetID() + 1: 1;

This would just change the pre-increment to a post-increment. The 
increment still needs to happen somewhere, as the function can add more 
than one symbol.

However, I don't have a problem with moving the increment out of the 
function call. That is what I've done in e5984a3.

Thanks for reviewing this,
Pavel


More information about the lldb-commits mailing list