core/vm: typo

This commit is contained in:
Marius van der Wijden 2024-09-02 17:06:47 +02:00
parent e4af62e5f2
commit 34d2744aaf

View file

@ -145,10 +145,10 @@ func (c *Container) MarshalBinary() []byte {
// UnmarshalBinary decodes an EOF container. // UnmarshalBinary decodes an EOF container.
func (c *Container) UnmarshalBinary(b []byte, isInitcode bool) error { func (c *Container) UnmarshalBinary(b []byte, isInitcode bool) error {
return c.unmarshaSubContainer(b, isInitcode, true) return c.unmarshalSubContainer(b, isInitcode, true)
} }
func (c *Container) unmarshaSubContainer(b []byte, isInitcode bool, topLevel bool) error { func (c *Container) unmarshalSubContainer(b []byte, isInitcode bool, topLevel bool) error {
if !hasEOFMagic(b) { if !hasEOFMagic(b) {
return fmt.Errorf("%w: want %x", ErrInvalidMagic, eofMagic) return fmt.Errorf("%w: want %x", ErrInvalidMagic, eofMagic)
} }
@ -291,7 +291,7 @@ func (c *Container) unmarshaSubContainer(b []byte, isInitcode bool, topLevel boo
} }
c := new(Container) c := new(Container)
end := min(idx+size, len(b)) end := min(idx+size, len(b))
if err := c.unmarshaSubContainer(b[idx:end], isInitcode, false); err != nil { if err := c.unmarshalSubContainer(b[idx:end], isInitcode, false); err != nil {
return fmt.Errorf("%w for section %d", err, i) return fmt.Errorf("%w for section %d", err, i)
} }
container = append(container, c) container = append(container, c)