[all-commits] [llvm/llvm-project] f9d3e9: [lld-macho] Improve robustness of ObjC category me...

alx32 via All-commits all-commits at lists.llvm.org
Fri Oct 18 11:03:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9d3e98207c8b5cd86d245050569eaf38809045d
      https://github.com/llvm/llvm-project/commit/f9d3e98207c8b5cd86d245050569eaf38809045d
  Author: alx32 <103613512+alx32 at users.noreply.github.com>
  Date:   2024-10-18 (Fri, 18 Oct 2024)

  Changed paths:
    M lld/MachO/ObjC.cpp
    M lld/test/MachO/objc-category-merging-minimal.s

  Log Message:
  -----------
  [lld-macho] Improve robustness of ObjC category merging (#112618)

This patch enhances the robustness of lld's Objective-C category
merging. Currently, the category merger assumes it can fully parse and
understand the format of all categories in the input, triggering an
assert if any invalid category data is encountered.

This will end up causing asserts in certain rare corner cases that are
difficult to reproduce in small test cases. The proposed changes modify
the behavior so that if invalid category data is detected, category
merging is skipped for that specific class and all other categories
sharing the same base class. This approach allows the linker to continue
processing other categories without failing entirely due to a single
problematic input.

We also add a LIT test to where we corrupt category data and check that
category merging for that class was skipped but the link was successful.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list