aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2021-09-07 20:29:34 -0700
committerRon Evans <[email protected]>2021-09-08 15:21:31 +0200
commit485a9284e74ea9ff8f0f37f2402ae80448b33f10 (patch)
tree6dfd6a21166a534d5fe125b2e4ba3db5f5b70654 /builder
parent602d3d7c788392147225c749d5099d7600b14d42 (diff)
downloadtinygo-485a9284e74ea9ff8f0f37f2402ae80448b33f10.tar.gz
tinygo-485a9284e74ea9ff8f0f37f2402ae80448b33f10.zip
builder: add missing error check for ioutil.TempFile()
Diffstat (limited to 'builder')
-rw-r--r--builder/cc.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/builder/cc.go b/builder/cc.go
index 7f0dad28a..3aac75586 100644
--- a/builder/cc.go
+++ b/builder/cc.go
@@ -155,6 +155,10 @@ func compileAndCacheCFile(abspath, tmpdir string, cflags []string, printCommands
// Write dependencies file.
f, err := ioutil.TempFile(filepath.Dir(depfileCachePath), depfileName)
+ if err != nil {
+ return "", err
+ }
+
buf, err = json.MarshalIndent(dependencySlice, "", "\t")
if err != nil {
panic(err) // shouldn't happen