[PATCH] D66130: [ELF] Initialize 2 fields of Symbol in SymbolTable::insert

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 04:54:40 PDT 2019


MaskRay added a comment.

In D66130#1635001 <https://reviews.llvm.org/D66130#1635001>, @ruiu wrote:

> It might make sense to zero-initialize a new instance with `memset(sym, 0, sizeof(Symbol))` before setting any (non-zero/false) values to sym members, as it is less error-prone. What do you think?


The list documents the fields that may be used while the symbol is still a placeholder. I worry that such auto zero initialization can hide problems that are harder to diagnose.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66130/new/

https://reviews.llvm.org/D66130





More information about the llvm-commits mailing list