aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Ou <rqou@robertou.com>2017-11-14 04:08:36 -0800
committerRobert Ou <rqou@robertou.com>2018-05-18 22:42:39 -0700
commit9763e4d830fa85aeb1577cab4dec9f4becc28f03 (patch)
tree5ad9c471cf554991b9b7a12817625441cedf124b
parentbd87462b47fdd8d7885269246ec1f7b685c6f86f (diff)
downloadyosys-9763e4d830fa85aeb1577cab4dec9f4becc28f03.tar.gz
yosys-9763e4d830fa85aeb1577cab4dec9f4becc28f03.tar.bz2
yosys-9763e4d830fa85aeb1577cab4dec9f4becc28f03.zip
Fix infinite loop in abc command under emscripten
-rw-r--r--passes/techmap/abc.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc
index 8e1484301..18868c6d7 100644
--- a/passes/techmap/abc.cc
+++ b/passes/techmap/abc.cc
@@ -550,11 +550,13 @@ std::string replace_tempdir(std::string text, std::string tempdir_name, bool sho
}
std::string selfdir_name = proc_self_dirname();
- while (1) {
- size_t pos = text.find(selfdir_name);
- if (pos == std::string::npos)
- break;
- text = text.substr(0, pos) + "<yosys-exe-dir>/" + text.substr(pos + GetSize(selfdir_name));
+ if (selfdir_name != "/") {
+ while (1) {
+ size_t pos = text.find(selfdir_name);
+ if (pos == std::string::npos)
+ break;
+ text = text.substr(0, pos) + "<yosys-exe-dir>/" + text.substr(pos + GetSize(selfdir_name));
+ }
}
return text;