Skip to content

Commit dca60e1

Browse files
committed
codetrie: ignore pushdata exceeding code length
1 parent 4632b49 commit dca60e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codetrie/codetrie.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,10 @@ func setFIO(chunks []*Chunk) {
240240
// restData is number of data bytes in next chunks.
241241
restData := (j + size + 1) - chunkSize
242242
spanningChunks := int(math.Ceil(float64(restData) / float64(chunkSize)))
243+
// Mostly happens in case of Solidity metadata at
244+
// the end of code.
243245
if i+spanningChunks >= len(chunks) {
244-
panic("pushdata exceeds code length")
246+
continue
245247
}
246248
k := 1
247249
for restData > chunkSize {

0 commit comments

Comments
 (0)