mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-07 06:33:24 +00:00
Merge pull request #1846 from dh73/ast_fe
Adding error message for when size (width) of number literal is zero
This commit is contained in:
commit
c69f4b246a
1 changed files with 3 additions and 0 deletions
|
@ -139,6 +139,9 @@ static void my_strtobin(std::vector<RTLIL::State> &data, const char *str, int le
|
||||||
data.resize(len_in_bits, msb);
|
data.resize(len_in_bits, msb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len_in_bits == 0)
|
||||||
|
log_file_error(current_filename, get_line_num(), "Illegal integer constant size of zero (IEEE 1800-2012, 5.7).\n");
|
||||||
|
|
||||||
if (len > len_in_bits)
|
if (len > len_in_bits)
|
||||||
log_warning("Literal has a width of %d bit, but value requires %d bit. (%s:%d)\n",
|
log_warning("Literal has a width of %d bit, but value requires %d bit. (%s:%d)\n",
|
||||||
len_in_bits, len, current_filename.c_str(), get_line_num());
|
len_in_bits, len, current_filename.c_str(), get_line_num());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue