Commit 4ac481b4 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke Committed by GitHub

core/vm, crypto: support for go-fuzz (#3672)

parent 94334c23
// +build gofuzz
package runtime
// Fuzz is the basic entry point for the go-fuzz tool
//
// This returns 1 for valid parsable/runable code, 0
// for invalid opcode.
func Fuzz(input []byte) int {
_, _, err := Execute(input, input, &Config{
GasLimit: 3000000,
})
// invalid opcode
if err != nil && len(err.Error()) > 6 && string(err.Error()[:7]) == "invalid" {
return 0
}
return 1
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment