compiler: fix unhandled error

This commit is contained in:
Anna Shaleva 2020-06-26 13:40:19 +03:00
parent 66b6a27b09
commit dc5da4f37e

View file

@ -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