diff --git a/src/cmd/5g/gsubr.c b/src/cmd/5g/gsubr.c index 70ebad6edd0..584a0f62b84 100644 --- a/src/cmd/5g/gsubr.c +++ b/src/cmd/5g/gsubr.c @@ -213,6 +213,9 @@ regalloc(Node *n, Type *t, Node *o) { int i, et, fixfree, floatfree; + // guarantee R9 and R10 (m and g) are left alone. BUG. + reg[9] = 1; + reg[10] = 1; if(debug['r']) { fixfree = 0; for(i=REGALLOC_R0; i<=REGALLOC_RMAX; i++) diff --git a/src/pkg/compress/flate/huffman_bit_writer.go b/src/pkg/compress/flate/huffman_bit_writer.go index abff82dd694..294cdf65329 100644 --- a/src/pkg/compress/flate/huffman_bit_writer.go +++ b/src/pkg/compress/flate/huffman_bit_writer.go @@ -110,8 +110,14 @@ func newHuffmanBitWriter(w io.Writer) *huffmanBitWriter { } func (err WrongValueError) String() string { - return "huffmanBitWriter: " + err.name + " should belong to [" + strconv.Itoa64(int64(err.from)) + ";" + - strconv.Itoa64(int64(err.to)) + "] but actual value is " + strconv.Itoa64(int64(err.value)) + // BUG: work around bug in 5g by simplifying expression. + // return "huffmanBitWriter: " + err.name + " should belong to [" + strconv.Itoa64(int64(err.from)) + ";" + + // strconv.Itoa64(int64(err.to)) + "] but actual value is " + strconv.Itoa64(int64(err.value)) + str := "huffmanBitWriter: " + err.name + " should belong to [" + str += strconv.Itoa64(int64(err.from)) + ";" + str += strconv.Itoa64(int64(err.to)) + "] but actual value is " + str += strconv.Itoa64(int64(err.value)) + return str } func (w *huffmanBitWriter) flushBits() { diff --git a/src/pkg/gob/decode.go b/src/pkg/gob/decode.go index a70799e9a72..a91a98bf157 100644 --- a/src/pkg/gob/decode.go +++ b/src/pkg/gob/decode.go @@ -867,9 +867,14 @@ func (dec *Decoder) compileDec(remoteId typeId, rt reflect.Type) (engine *decEng continue } if !dec.compatibleType(localField.Type, wireField.id) { - return nil, os.ErrorString("gob: wrong type (" + - localField.Type.String() + ") for received field " + - wireStruct.name + "." + wireField.name) + // BUG: work around bug in 5g by simplifying expression. + // return nil, os.ErrorString("gob: wrong type (" + + // localField.Type.String() + ") for received field " + + // wireStruct.name + "." + wireField.name) + str := "gob: wrong type (" + str += localField.Type.String() + ") for received field " + str += wireStruct.name + "." + wireField.name + return nil, os.ErrorString(str) } op, indir, err := dec.decOpFor(wireField.id, localField.Type, localField.Name) if err != nil { diff --git a/src/pkg/log/log.go b/src/pkg/log/log.go index 28d6204eb68..cfc1bd7767f 100644 --- a/src/pkg/log/log.go +++ b/src/pkg/log/log.go @@ -86,7 +86,11 @@ func (l *Logger) formatHeader(ns int64, calldepth int) string { if l.flag&(Ldate|Ltime|Lmicroseconds) != 0 { t := time.SecondsToLocalTime(ns / 1e9) if l.flag&(Ldate) != 0 { - h += itoa(int(t.Year), 4) + "/" + itoa(t.Month, 2) + "/" + itoa(t.Day, 2) + " " + // BUG: work around bug in 5g by simplifying expression. + // h += itoa(int(t.Year), 4) + "/" + itoa(t.Month, 2) + "/" + itoa(t.Day, 2) + " " + h += itoa(int(t.Year), 4) + h += "/" + itoa(t.Month, 2) + h += "/" + itoa(t.Day, 2) + " " } if l.flag&(Ltime|Lmicroseconds) != 0 { h += itoa(t.Hour, 2) + ":" + itoa(t.Minute, 2) + ":" + itoa(t.Second, 2) diff --git a/src/pkg/net/ip.go b/src/pkg/net/ip.go index e82224a2836..29a72971f5a 100644 --- a/src/pkg/net/ip.go +++ b/src/pkg/net/ip.go @@ -200,10 +200,16 @@ func (ip IP) String() string { // If IPv4, use dotted notation. if p4 := p.To4(); len(p4) == 4 { - return itod(uint(p4[0])) + "." + - itod(uint(p4[1])) + "." + - itod(uint(p4[2])) + "." + - itod(uint(p4[3])) + // BUG: work around bug in 5g by simplifying expression. + // return itod(uint(p4[0])) + "." + + // itod(uint(p4[1])) + "." + + // itod(uint(p4[2])) + "." + + // itod(uint(p4[3])) + str := itod(uint(p4[0])) + "." + str += itod(uint(p4[1])) + "." + str += itod(uint(p4[2])) + "." + str += itod(uint(p4[3])) + return str } if len(p) != IPv6len { return "?" diff --git a/src/pkg/time/format.go b/src/pkg/time/format.go index 355721e1839..bc94cb78e24 100644 --- a/src/pkg/time/format.go +++ b/src/pkg/time/format.go @@ -356,11 +356,17 @@ type ParseError struct { // String is the string representation of a ParseError. func (e *ParseError) String() string { if e.Message == "" { - return "parsing time " + - strconv.Quote(e.Value) + " as " + - strconv.Quote(e.Layout) + ": cannot parse " + - strconv.Quote(e.ValueElem) + " as " + - strconv.Quote(e.LayoutElem) + // BUG: work around bug in 5g by simplifying expression. + // return "parsing time " + + // strconv.Quote(e.Value) + " as " + + // strconv.Quote(e.Layout) + ": cannot parse " + + // strconv.Quote(e.ValueElem) + " as " + + // strconv.Quote(e.LayoutElem) + str := "parsing time " + strconv.Quote(e.Value) + " as " + str += strconv.Quote(e.Layout) + ": cannot parse " + str += strconv.Quote(e.ValueElem) + " as " + str += strconv.Quote(e.LayoutElem) + return str } return "parsing time " + strconv.Quote(e.Value) + e.Message diff --git a/src/pkg/xml/xml.go b/src/pkg/xml/xml.go index cd67f6e2657..c72d726c76e 100644 --- a/src/pkg/xml/xml.go +++ b/src/pkg/xml/xml.go @@ -371,8 +371,14 @@ func (p *Parser) popElement(t *EndElement) bool { p.err = p.syntaxError("element <" + s.name.Local + "> closed by ") return false case s.name.Space != name.Space: - p.err = p.syntaxError("element <" + s.name.Local + "> in space " + s.name.Space + - "closed by in space " + name.Space) + // BUG: work around bug in 5g by simplifying expression. + // p.err = p.syntaxError("element <" + s.name.Local + "> in space " + s.name.Space + + // "closed by in space " + name.Space) + str := "element <" + s.name.Local + str += "> in space " + s.name.Space + str += "closed by in space " + name.Space + p.err = p.syntaxError(str) return false }