diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2023-01-17 12:58:08 +0100 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2023-01-17 12:58:08 +0100 |
commit | 6574553189fb6ccb5d00a0c043671a625672b3d3 (patch) | |
tree | 57e3212ee75493d9f4939c9f9029b95880367a76 /backends/jny | |
parent | 956c4e485a9463863f60c4dd03372db3fa8332a4 (diff) | |
download | yosys-6574553189fb6ccb5d00a0c043671a625672b3d3.tar.gz yosys-6574553189fb6ccb5d00a0c043671a625672b3d3.tar.bz2 yosys-6574553189fb6ccb5d00a0c043671a625672b3d3.zip |
Fixes for some of clang scan-build detected issues
Diffstat (limited to 'backends/jny')
-rw-r--r-- | backends/jny/jny.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/backends/jny/jny.cc b/backends/jny/jny.cc index 2b8d51b76..0be11a52c 100644 --- a/backends/jny/jny.cc +++ b/backends/jny/jny.cc @@ -546,8 +546,9 @@ struct JnyPass : public Pass { std::ostream *f; std::stringstream buf; + bool empty = filename.empty(); - if (!filename.empty()) { + if (!empty) { rewrite_filename(filename); std::ofstream *ff = new std::ofstream; ff->open(filename.c_str(), std::ofstream::trunc); @@ -565,7 +566,7 @@ struct JnyPass : public Pass { JnyWriter jny_writer(*f, false, connections, attributes, properties); jny_writer.write_metadata(design, 0, invk.str()); - if (!filename.empty()) { + if (!empty) { delete f; } else { log("%s", buf.str().c_str()); |