summaryrefslogtreecommitdiff
path: root/src/pkg/debug/dwarf
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/debug/dwarf')
-rw-r--r--src/pkg/debug/dwarf/Makefile2
-rw-r--r--src/pkg/debug/dwarf/type.go26
2 files changed, 4 insertions, 24 deletions
diff --git a/src/pkg/debug/dwarf/Makefile b/src/pkg/debug/dwarf/Makefile
index a626513c7..c4203188e 100644
--- a/src/pkg/debug/dwarf/Makefile
+++ b/src/pkg/debug/dwarf/Makefile
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../../Make.$(GOARCH)
+include ../../../Make.inc
TARG=debug/dwarf
GOFILES=\
diff --git a/src/pkg/debug/dwarf/type.go b/src/pkg/debug/dwarf/type.go
index 5d4a51653..902a545f8 100644
--- a/src/pkg/debug/dwarf/type.go
+++ b/src/pkg/debug/dwarf/type.go
@@ -451,16 +451,7 @@ func (d *Data) Type(off Offset) (Type, os.Error) {
f.ByteSize, _ = kid.Val(AttrByteSize).(int64)
f.BitOffset, _ = kid.Val(AttrBitOffset).(int64)
f.BitSize, _ = kid.Val(AttrBitSize).(int64)
- n := len(t.Field)
- if n >= cap(t.Field) {
- fld := make([]*StructField, n, n*2)
- for i, f := range t.Field {
- fld[i] = f
- }
- t.Field = fld
- }
- t.Field = t.Field[0 : n+1]
- t.Field[n] = f
+ t.Field = append(t.Field, f)
}
}
@@ -505,9 +496,7 @@ func (d *Data) Type(off Offset) (Type, os.Error) {
n := len(t.Val)
if n >= cap(t.Val) {
val := make([]*EnumValue, n, n*2)
- for i, f := range t.Val {
- val[i] = f
- }
+ copy(val, t.Val)
t.Val = val
}
t.Val = t.Val[0 : n+1]
@@ -558,16 +547,7 @@ func (d *Data) Type(off Offset) (Type, os.Error) {
case TagUnspecifiedParameters:
tkid = &DotDotDotType{}
}
- n := len(t.ParamType)
- if n >= cap(t.ParamType) {
- param := make([]Type, n, n*2)
- for i, t := range t.ParamType {
- param[i] = t
- }
- t.ParamType = param
- }
- t.ParamType = t.ParamType[0 : n+1]
- t.ParamType[n] = tkid
+ t.ParamType = append(t.ParamType, tkid)
}
case TagTypedef: