Skip to content

Commit

Permalink
[lld-macho] Fix unwind info personality size
Browse files Browse the repository at this point in the history
This was missed by {D107035}. This fix addresses the following warning:

  loop variable 'personality' has type 'const uint32_t &' (aka 'const unsigned int &') but is initialized with type 'const unsigned long long' resulting in a copy [-Wrange-loop-analysis]

In addition to fixing the size, I also removed the const reference,
since there's no performance benefit to avoiding copies of integer-sized
values.
  • Loading branch information
int3 committed Aug 26, 2021
1 parent 1e35a76 commit 2179930
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lld/MachO/UnwindInfoSection.cpp
Expand Up @@ -572,7 +572,7 @@ void UnwindInfoSectionImpl<Ptr>::writeTo(uint8_t *buf) const {
*i32p++ = encoding.first;

// Personalities
for (const uint32_t &personality : personalities)
for (Ptr personality : personalities)
*i32p++ =
in.got->addr + (personality - 1) * target->wordSize - in.header->addr;

Expand Down

0 comments on commit 2179930

Please sign in to comment.