From 5917692b98695b606744f638224a82a2472bfeaa Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 24 Sep 2014 16:53:47 -0400 Subject: debug/dwarf: correct name for clang-generated complex type Fixes #8694. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/143570043 --- src/debug/dwarf/type.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/debug/dwarf') diff --git a/src/debug/dwarf/type.go b/src/debug/dwarf/type.go index fa40b2bef1..6986b19e72 100644 --- a/src/debug/dwarf/type.go +++ b/src/debug/dwarf/type.go @@ -431,6 +431,17 @@ func (d *Data) readType(name string, r typeReader, off Offset, typeCache map[Off typ = new(BoolType) case encComplexFloat: typ = new(ComplexType) + if name == "complex" { + // clang writes out 'complex' instead of 'complex float' or 'complex double'. + // clang also writes out a byte size that we can use to distinguish. + // See issue 8694. + switch byteSize, _ := e.Val(AttrByteSize).(int64); byteSize { + case 8: + name = "complex float" + case 16: + name = "complex double" + } + } case encFloat: typ = new(FloatType) case encSigned: -- cgit v1.3