[PATCH] D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic).

Patrick Walton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 17:54:38 PDT 2022


pcwalton updated this revision to Diff 438080.
pcwalton added a comment.

So this was a fun one. The previous version of this patch accidentally caused a
pre-existing bug to surface and break Chromium. In certain circumstances
including the Chromium test case, `available_externally` symbols would cause
invalid lookups in the `SymSize` table. Before this patch, the lookups were
done with the `[]` operator, which would succeed but cause an unspecified value
to be emitted in the `.debug_aranges` table. But this patch moves those lookups
to be done by dereferencing the result of the `.find()` method, which causes
asserts if the key is not found.

This patch fixes this bug and adds a test. It took quite a while to reduce all
150kloc+ of code...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126835

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/test/CodeGen/X86/dwarf-aranges-available-externally.ll
  llvm/test/CodeGen/X86/dwarf-aranges-zero-size.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126835.438080.patch
Type: text/x-patch
Size: 7535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220618/cafe070b/attachment.bin>


More information about the llvm-commits mailing list