mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 02:45:52 +00:00
verilog: impose limit on maximum expression width
Designs with unreasonably wide expressions would previously get stuck allocating memory forever.
This commit is contained in:
parent
7d2097b005
commit
c18ddbcd82
3 changed files with 39 additions and 0 deletions
|
@ -1000,6 +1000,12 @@ void AstNode::detectSignWidth(int &width_hint, bool &sign_hint, bool *found_real
|
|||
if (found_real)
|
||||
*found_real = false;
|
||||
detectSignWidthWorker(width_hint, sign_hint, found_real);
|
||||
|
||||
constexpr int kWidthLimit = 1 << 24;
|
||||
if (width_hint >= kWidthLimit)
|
||||
log_file_error(filename, location.first_line,
|
||||
"Expression width %d exceeds implementation limit of %d!\n",
|
||||
width_hint, kWidthLimit);
|
||||
}
|
||||
|
||||
static void check_unique_id(RTLIL::Module *module, RTLIL::IdString id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue