summaryrefslogtreecommitdiff
path: root/user/llvm18/macho32.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-07-06 20:37:32 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-07 10:08:22 -0500
commite2ec142d7bfd9f2465c62900a03e3accf4adf572 (patch)
treee1f4499d59088adf1da20797fb9f260c2e87bf05 /user/llvm18/macho32.patch
parentc5c08854322efc2aea8f8bcf51a544976fd86a12 (diff)
downloadpackages-e2ec142d7bfd9f2465c62900a03e3accf4adf572.tar.gz
packages-e2ec142d7bfd9f2465c62900a03e3accf4adf572.tar.bz2
packages-e2ec142d7bfd9f2465c62900a03e3accf4adf572.tar.xz
packages-e2ec142d7bfd9f2465c62900a03e3accf4adf572.zip
user/llvm18: New package
Diffstat (limited to 'user/llvm18/macho32.patch')
-rw-r--r--user/llvm18/macho32.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/user/llvm18/macho32.patch b/user/llvm18/macho32.patch
new file mode 100644
index 000000000..e18098372
--- /dev/null
+++ b/user/llvm18/macho32.patch
@@ -0,0 +1,17 @@
+Use integer offset math instead of pointer math to determine load
+command bounds.
+
+Upstream-URL: https://github.com/llvm/llvm-project/issues/56746
+
+--- llvm-14.0.6.src/lib/Object/MachOObjectFile.cpp.old 2022-06-22 16:46:24.000000000 +0000
++++ llvm-14.0.6.src/lib/Object/MachOObjectFile.cpp 2022-11-28 04:21:02.730211841 +0000
+@@ -192,7 +192,8 @@
+ getLoadCommandInfo(const MachOObjectFile &Obj, const char *Ptr,
+ uint32_t LoadCommandIndex) {
+ if (auto CmdOrErr = getStructOrErr<MachO::load_command>(Obj, Ptr)) {
+- if (CmdOrErr->cmdsize + Ptr > Obj.getData().end())
++ uint64_t Offset = Ptr - Obj.getData().begin();
++ if (CmdOrErr->cmdsize + Offset > Obj.getData().size())
+ return malformedError("load command " + Twine(LoadCommandIndex) +
+ " extends past end of file");
+ if (CmdOrErr->cmdsize < 8)