diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-06 10:30:54 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-06 10:30:54 +0200 |
| commit | 606f9a96d815721fa6583615d327973986a1abad (patch) | |
| tree | e2d40e334919a33549ae79d76c6654281aa18cb9 /pkg/instance/instance.go | |
| parent | 41f9540d7aea0348e4c4bdba6d6c0a7fa0f24a68 (diff) | |
pkg/csource: allow to build source fom memory
In most cases we have source in memory,
so provide a function to build right from memory
without creating temp files.
Diffstat (limited to 'pkg/instance/instance.go')
| -rw-r--r-- | pkg/instance/instance.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 84e3c518d..98893a590 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -300,15 +300,11 @@ func (inst *inst) testRepro() error { if len(inst.reproC) == 0 { return nil } - cFile := filepath.Join(cfg.Workdir, "repro.c") - if err := osutil.WriteFile(cFile, inst.reproC); err != nil { - return fmt.Errorf("failed to write temp file: %v", err) - } target, err := prog.GetTarget(cfg.TargetOS, cfg.TargetArch) if err != nil { return err } - bin, err := csource.Build(target, "c", cFile) + bin, err := csource.Build(target, inst.reproC) if err != nil { return err } |
