mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-14 11:15:40 +00:00
Fixed Overflow error in checking width
This commit is contained in:
parent
5cd9efefe3
commit
eb4e29810e
1 changed files with 8 additions and 6 deletions
|
|
@ -529,9 +529,10 @@ struct RTLILFrontendWorker {
|
|||
break;
|
||||
}
|
||||
if (try_parse_keyword("width")){
|
||||
width = parse_integer();
|
||||
if (width >= RTLIL::WIDTH_LIMIT)
|
||||
error("Wire width %lld out of range before `%s`.", width, error_token());
|
||||
long long width_val = parse_integer();
|
||||
if (width_val < 0 || width_val >= RTLIL::WIDTH_LIMIT)
|
||||
error("Wire width %lld out of range before `%s`.", width_val, error_token());
|
||||
width = width_val;
|
||||
}
|
||||
else if (try_parse_keyword("upto"))
|
||||
upto = true;
|
||||
|
|
@ -589,9 +590,10 @@ struct RTLILFrontendWorker {
|
|||
break;
|
||||
}
|
||||
if (try_parse_keyword("width")){
|
||||
width = parse_integer();
|
||||
if (width >= RTLIL::WIDTH_LIMIT)
|
||||
error("Memory width %lld out of range before `%s`.", width, error_token());
|
||||
long long width_val = parse_integer();
|
||||
if (width_val < 0 || width_val >= RTLIL::WIDTH_LIMIT)
|
||||
error("Memory width %lld out of range before `%s`.", width_val, error_token());
|
||||
width = width_val;
|
||||
}
|
||||
else if (try_parse_keyword("size"))
|
||||
size = parse_integer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue