diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 292b5d7bd..c17f33e2f 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -109,9 +109,12 @@ func CompileAndSave(src string, o *Options) ([]byte, error) { } out := fmt.Sprintf("%s.%s", o.Outfile, o.Ext) err = ioutil.WriteFile(out, bytes, os.ModePerm) - if o.DebugInfo == "" { + if err != nil { return b, err } + if o.DebugInfo == "" { + return b, nil + } p, err := filepath.Abs(src) if err != nil { return b, err