Skip to content

Commit 7301434

Browse files
committed
Handle functions with no stack map entries.
1 parent 3b81b64 commit 7301434

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

gocore/parse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ func (m *module) readFunc(r region, pcln region) *Func {
462462
// Read pcln tables we need.
463463
if stackmap := int(r.p.rtConstants["_PCDATA_StackMapIndex"]); stackmap < len(f.pcdata) {
464464
f.stackMap.read(r.p.proc, pcln.SliceIndex(int64(f.pcdata[stackmap])).a)
465+
} else {
466+
f.stackMap.setEmpty()
465467
}
466468

467469
return f

gocore/pctab.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ func (p *pcTab) read(core *core.Process, data core.Address) {
4848
}
4949
}
5050

51+
func (p *pcTab) setEmpty() {
52+
p.entries = []pcTabEntry{{bytes: 1<<63 - 1, val: -1}}
53+
}
54+
5155
func (t *pcTab) find(off int64) int64 {
5256
for _, e := range t.entries {
5357
if off < e.bytes {

0 commit comments

Comments
 (0)