summaryrefslogtreecommitdiffstats
path: root/src/sat/bsat2/Vec.h
diff options
context:
space:
mode:
authorClaire Xen <claire@clairexen.net>2022-02-15 17:57:27 +0100
committerGitHub <noreply@github.com>2022-02-15 17:57:27 +0100
commit57ef73b2053ad644cfecd608dafdb9b848fc6cdb (patch)
tree0c3ff28e48071a2c921b7ed1fe7218124c1df629 /src/sat/bsat2/Vec.h
parent9b245d9f6910c048e9bbcf95ee5dee46f2f24f2c (diff)
parent264dfc7ed414476438e4a858258f5516d7b863c6 (diff)
downloadabc-57ef73b2053ad644cfecd608dafdb9b848fc6cdb.tar.gz
abc-57ef73b2053ad644cfecd608dafdb9b848fc6cdb.tar.bz2
abc-57ef73b2053ad644cfecd608dafdb9b848fc6cdb.zip
Merge pull request #10 from YosysHQ/yosys-experimental
Integrate write_cex and cexinfo and some fixes in write_cex output code
Diffstat (limited to 'src/sat/bsat2/Vec.h')
-rw-r--r--src/sat/bsat2/Vec.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sat/bsat2/Vec.h b/src/sat/bsat2/Vec.h
index f0e07d01..5eea6174 100644
--- a/src/sat/bsat2/Vec.h
+++ b/src/sat/bsat2/Vec.h
@@ -97,7 +97,11 @@ void vec<T>::capacity(int min_cap) {
if (cap >= min_cap) return;
int add = imax((min_cap - cap + 1) & ~1, ((cap >> 1) + 2) & ~1); // NOTE: grow by approximately 3/2
if (add > INT_MAX - cap || (((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM))
+#ifdef __wasm
+ abort();
+#else
throw OutOfMemoryException();
+#endif
}