cmd/compile: prefer base.Fatalf to panic in dwarfgen

Updates a few spots which call `panic` to instead call `base.Fatalf`.
This commit is contained in:
Derek Parker 2025-07-14 15:22:41 -07:00
parent 9159cd4ec6
commit b3839bbe42

View file

@ -203,7 +203,7 @@ func createDwarfVars(fnsym *obj.LSym, complexOK bool, fn *ir.Func, apDecls []*ir
continue continue
} }
if n.Class != ir.PPARAMOUT || !n.IsOutputParamInRegisters() { if n.Class != ir.PPARAMOUT || !n.IsOutputParamInRegisters() {
panic("invalid ir.Name on debugInfo.RegOutputParams list") base.Fatalf("invalid ir.Name on debugInfo.RegOutputParams list")
} }
dcl = append(dcl, n) dcl = append(dcl, n)
} }
@ -554,7 +554,7 @@ func createComplexVar(fnsym *obj.LSym, fn *ir.Func, varID ssa.VarID, closureVars
// in the DWARF info. // in the DWARF info.
func RecordFlags(flags ...string) { func RecordFlags(flags ...string) {
if base.Ctxt.Pkgpath == "" { if base.Ctxt.Pkgpath == "" {
panic("missing pkgpath") base.Fatalf("missing pkgpath")
} }
type BoolFlag interface { type BoolFlag interface {