Skip to content

Commit

Permalink
Handle functions with no stack map entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
randall77 committed Oct 23, 2017
1 parent 3b81b64 commit 7301434
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gocore/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ func (m *module) readFunc(r region, pcln region) *Func {
// Read pcln tables we need.
if stackmap := int(r.p.rtConstants["_PCDATA_StackMapIndex"]); stackmap < len(f.pcdata) {
f.stackMap.read(r.p.proc, pcln.SliceIndex(int64(f.pcdata[stackmap])).a)
} else {
f.stackMap.setEmpty()
}

return f
Expand Down
4 changes: 4 additions & 0 deletions gocore/pctab.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func (p *pcTab) read(core *core.Process, data core.Address) {
}
}

func (p *pcTab) setEmpty() {
p.entries = []pcTabEntry{{bytes: 1<<63 - 1, val: -1}}
}

func (t *pcTab) find(off int64) int64 {
for _, e := range t.entries {
if off < e.bytes {
Expand Down

0 comments on commit 7301434

Please sign in to comment.