mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
396 B
21 lines
396 B
8 years ago
|
// +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
|
||
|
}
|