diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-01-17 12:40:45 +0100 |
commit | 3e45412327a2654a77944249962b3652e6142299 (patch) | |
tree | bc3bf69452afa055423cbe0c5cfa8ca357df6ccf /src/pkg/debug/dwarf | |
parent | c533680039762cacbc37db8dc7eed074c3e497be (diff) | |
download | golang-upstream/2011.01.12.tar.gz |
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'src/pkg/debug/dwarf')
-rw-r--r-- | src/pkg/debug/dwarf/Makefile | 2 | ||||
-rw-r--r-- | src/pkg/debug/dwarf/type.go | 26 |
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: |