3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-20 07:36:39 +00:00

liberty: Error when a read liberty file has no nodes

This commit is contained in:
Jannis Harder 2025-04-16 19:03:05 +02:00
parent 5101b9fcba
commit 418e795235

View file

@ -176,6 +176,14 @@ namespace Yosys
LibertyParser(std::istream &f) : f(f), line(1) {
shared_ast.reset(parse());
ast = shared_ast.get();
if (!ast) {
#ifdef FILTERLIB
fprintf(stderr, "No entries found in liberty file.\n");
exit(1);
#else
log_error("No entries found in liberty file.\n");
#endif
}
}
#ifndef FILTERLIB
@ -186,6 +194,9 @@ namespace Yosys
LibertyAstCache::instance.parsed_ast(fname, shared_ast);
}
ast = shared_ast.get();
if (!ast) {
log_error("No entries found in liberty file `%s'.\n", fname.c_str());
}
}
#endif
};