core/vm: check for returnStack overflow in opCallf

This commit is contained in:
Marius van der Wijden 2024-06-26 11:11:18 +02:00
parent e1b9f4a6f5
commit 3d8ca3c526

View file

@ -823,6 +823,9 @@ func opCallf(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
if scope.Stack.len()+int(typ.MaxStackHeight) >= 1024 { if scope.Stack.len()+int(typ.MaxStackHeight) >= 1024 {
return nil, fmt.Errorf("stack overflow") return nil, fmt.Errorf("stack overflow")
} }
if len(scope.ReturnStack) >= 1024 {
return nil, fmt.Errorf("return stack overflow")
}
retCtx := &ReturnContext{ retCtx := &ReturnContext{
Section: scope.CodeSection, Section: scope.CodeSection,
Pc: *pc + 3, Pc: *pc + 3,