From 23b5b5fa36530eb82543d7d877f8e9e1900232cf Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 4 Jul 2014 13:34:50 +0200 Subject: Length check --- ethutil/script.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ethutil') diff --git a/ethutil/script.go b/ethutil/script.go index aaa0f8ed8..fa05094e7 100644 --- a/ethutil/script.go +++ b/ethutil/script.go @@ -13,7 +13,7 @@ func Compile(script string) (ret []byte, err error) { if len(script) > 2 { line := strings.Split(script, "\n")[0] - if line[0:2] == "#!" { + if len(line) > 1 && line[0:2] == "#!" { switch line { case "#!serpent": byteCode, err := serpent.Compile(script) -- cgit v1.2.3 From 90eb4f1939f7b0389d5784b889cc0e5d2b3451f7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 4 Jul 2014 15:32:10 +0200 Subject: Debug output, minor fixes and tweaks * Script compile length fix * Transition fix --- ethutil/script.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ethutil') diff --git a/ethutil/script.go b/ethutil/script.go index fa05094e7..f5c53f84c 100644 --- a/ethutil/script.go +++ b/ethutil/script.go @@ -9,7 +9,7 @@ import ( ) // General compile function -func Compile(script string) (ret []byte, err error) { +func Compile(script string, silent bool) (ret []byte, err error) { if len(script) > 2 { line := strings.Split(script, "\n")[0] @@ -26,6 +26,7 @@ func Compile(script string) (ret []byte, err error) { } else { compiler := mutan.NewCompiler(backend.NewEthereumBackend()) + compiler.Silent = silent byteCode, errors := compiler.Compile(strings.NewReader(script)) if len(errors) > 0 { var errs string -- cgit v1.2.3