Skip to content

Commit cd2da72

Browse files
authored
Merge pull request swiftlang#86814 from al45tair/eng/PR-168996222-6.3
[6.3][Backtracing] For DWARF 3, skip `maximum_operations_per_instruction`
2 parents 6063dec + e3afb32 commit cd2da72

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stdlib/public/RuntimeModule/Dwarf.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,13 @@ struct DwarfReader<S: DwarfSource & AnyObject> {
851851
// .6 minimum_instruction_length
852852
let minimumInstructionLength = UInt(try cursor.read(as: Dwarf_Byte.self))
853853

854-
// .7 maximum_operations_per_instruction
855-
let maximumOpsPerInstruction = UInt(try cursor.read(as: Dwarf_Byte.self))
854+
let maximumOpsPerInstruction: UInt
855+
if version >= 4 {
856+
// .7 maximum_operations_per_instruction
857+
maximumOpsPerInstruction = UInt(try cursor.read(as: Dwarf_Byte.self))
858+
} else {
859+
maximumOpsPerInstruction = 1
860+
}
856861

857862
// .8 default_is_stmt
858863
let defaultIsStmt = try cursor.read(as: Dwarf_Byte.self) != 0

0 commit comments

Comments
 (0)