An array subscript getter out-of-bounds trap has an invalid line location in the LLVM debug information, leading to a wrong line location in the crash. This is for PDB for windows.
Reproduction
import FoundationXML
import Foundation
public struct AppInstaller: Equatable {
public init(with root: XMLElement) throws {
let element = root.elements(forName: "MainPackage")[0]
}
}
Description
An array subscript getter out-of-bounds trap has an invalid line location in the LLVM debug information, leading to a wrong line location in the crash. This is for PDB for windows.
Reproduction
build with
you can see that the
llvm.trap
instruction has a debug location with line entry 0, which isn't preserved in PDB.Expected behavior
The original location should be preserved without a zero line.
Environment
swift --version Swift version 6.0-dev (LLVM 73a346c9caf32cc, Swift e2ad12ba5c3bc2a) Target: x86_64-unknown-windows-msvc
Additional information
No response