authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-07-13 00:02:35-04:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-07-20 22:58:16-04:00
log7d8b4234774200ff071103399613ed444280a8d0
tree5c9544d9f110ab727f1e0f983b865772e8db7f86
parent9549b4acf67ec7dfcebf5373c11cdc7af3d41aae

macho: remove unnecessary checks


1 files changed, 1 insertions(+), 3 deletions(-)

lib/std/macho.zig+1-3
...@@ -2171,7 +2171,7 @@ pub fn unwindFrame(context: *dwarf.UnwindContext, unwind_info: []const u8, modul...@@ -2171,7 +2171,7 @@ pub fn unwindFrame(context: *dwarf.UnwindContext, unwind_info: []const u8, modul
2171 }2171 }
21722172
2173 // Last index is a sentinel containing the highest address as its functionOffset2173 // Last index is a sentinel containing the highest address as its functionOffset
2174 if (len == 0 or indices[left].secondLevelPagesSectionOffset == 0) return error.MissingUnwindInfo;2174 if (indices[left].secondLevelPagesSectionOffset == 0) return error.MissingUnwindInfo;
2175 break :blk &indices[left];2175 break :blk &indices[left];
2176 };2176 };
21772177
...@@ -2216,7 +2216,6 @@ pub fn unwindFrame(context: *dwarf.UnwindContext, unwind_info: []const u8, modul...@@ -2216,7 +2216,6 @@ pub fn unwindFrame(context: *dwarf.UnwindContext, unwind_info: []const u8, modul
2216 }2216 }
2217 }2217 }
22182218
2219 if (len == 0) return error.InvalidUnwindInfo;
2220 break :blk .{2219 break :blk .{
2221 .function_offset = entries[left].functionOffset,2220 .function_offset = entries[left].functionOffset,
2222 .raw_encoding = entries[left].encoding,2221 .raw_encoding = entries[left].encoding,
...@@ -2248,7 +2247,6 @@ pub fn unwindFrame(context: *dwarf.UnwindContext, unwind_info: []const u8, modul...@@ -2248,7 +2247,6 @@ pub fn unwindFrame(context: *dwarf.UnwindContext, unwind_info: []const u8, modul
2248 }2247 }
2249 }2248 }
22502249
2251 if (len == 0) return error.InvalidUnwindInfo;
2252 const entry = entries[left];2250 const entry = entries[left];
2253 const function_offset = second_level_index.functionOffset + entry.funcOffset;2251 const function_offset = second_level_index.functionOffset + entry.funcOffset;
2254 if (entry.encodingIndex < header.commonEncodingsArrayCount) {2252 if (entry.encodingIndex < header.commonEncodingsArrayCount) {