// Take the name from the original, lest we substituted it with ~r%d or ~b%d.
// ~r%d is a (formerly) unnamed result.
if asNode(f.Nname) != nil {
- if asNode(f.Nname).Orig != nil {
- s = asNode(f.Nname).Orig.Sym
- if s != nil && s.Name[0] == '~' {
- if s.Name[1] == 'r' { // originally an unnamed result
- return "" // s = nil
- } else if s.Name[1] == 'b' { // originally the blank identifier _
- return "_" // belongs to localpkg
- }
- }
- } else {
+ if asNode(f.Nname).Orig == nil {
return "" // s = nil
}
+ s = asNode(f.Nname).Orig.Sym
+ if s != nil && s.Name[0] == '~' {
+ if s.Name[1] == 'r' { // originally an unnamed result
+ return "" // s = nil
+ } else if s.Name[1] == 'b' { // originally the blank identifier _
+ return "_" // belongs to localpkg
+ }
+ }
}
if s == nil {
// their section Vaddr, using n for index
n := 1
for _, sect := range Segtext.Sections[1:] {
- if sect.Name == ".text" {
- symname := fmt.Sprintf("runtime.text.%d", n)
- ctxt.xdefine(symname, sym.STEXT, int64(sect.Vaddr))
- n++
- } else {
+ if sect.Name != ".text" {
break
}
+ symname := fmt.Sprintf("runtime.text.%d", n)
+ ctxt.xdefine(symname, sym.STEXT, int64(sect.Vaddr))
+ n++
}
ctxt.xdefine("runtime.rodata", sym.SRODATA, int64(rodata.Vaddr))
continue
}
encodedPart := simplePart + "*"
- if v, ok := pieceMap[encodedPart]; ok {
- valid = true
- if n == 0 {
- if decv, ok := decode2231Enc(v); ok {
- buf.WriteString(decv)
- }
- } else {
- decv, _ := percentHexUnescape(v)
+ v, ok := pieceMap[encodedPart]
+ if !ok {
+ break
+ }
+ valid = true
+ if n == 0 {
+ if decv, ok := decode2231Enc(v); ok {
buf.WriteString(decv)
}
} else {
- break
+ decv, _ := percentHexUnescape(v)
+ buf.WriteString(decv)
}
}
if valid {
typ := tt.elem
fl := (v.flag | key.flag).ro()
fl |= flag(typ.Kind())
- if ifaceIndir(typ) {
- // Copy result so future changes to the map
- // won't change the underlying value.
- c := unsafe_New(typ)
- typedmemmove(typ, c, e)
- return Value{typ, c, fl | flagIndir}
- } else {
+ if !ifaceIndir(typ) {
return Value{typ, *(*unsafe.Pointer)(e), fl}
}
+ // Copy result so future changes to the map
+ // won't change the underlying value.
+ c := unsafe_New(typ)
+ typedmemmove(typ, c, e)
+ return Value{typ, c, fl | flagIndir}
}
// MapKeys returns a slice containing all the keys present in the map,
if pos == 0 && syntax.EmptyOp(inst.Arg)&^flag == 0 &&
len(m.re.prefix) > 0 && i.canCheckPrefix() {
// Match requires literal prefix; fast search for it.
- if i.hasPrefix(m.re) {
- pos += len(m.re.prefix)
- r, width = i.step(pos)
- r1, width1 = i.step(pos + width)
- flag = i.context(pos)
- pc = int(m.re.prefixEnd)
- } else {
+ if !i.hasPrefix(m.re) {
return m.matched
}
+ pos += len(m.re.prefix)
+ r, width = i.step(pos)
+ r1, width1 = i.step(pos + width)
+ flag = i.context(pos)
+ pc = int(m.re.prefixEnd)
}
for {
inst = m.op.Inst[pc]
discardable := true // true if all cells in this column are empty and "soft"
for ; this < line1; this++ {
line = b.lines[this]
- if column < len(line)-1 {
- // cell exists in this column
- c := line[column]
- // update width
- if w := c.width + b.padding; w > width {
- width = w
- }
- // update discardable
- if c.width > 0 || c.htab {
- discardable = false
- }
- } else {
+ if column >= len(line)-1 {
break
}
+ // cell exists in this column
+ c := line[column]
+ // update width
+ if w := c.width + b.padding; w > width {
+ width = w
+ }
+ // update discardable
+ if c.width > 0 || c.htab {
+ discardable = false
+ }
}
// column block end