mirror of https://github.com/YosysHQ/yosys.git
Fixed Overflow error in checking width
This commit is contained in:
parent
5cd9efefe3
commit
eb4e29810e
|
|
@ -529,9 +529,10 @@ struct RTLILFrontendWorker {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (try_parse_keyword("width")){
|
if (try_parse_keyword("width")){
|
||||||
width = parse_integer();
|
long long width_val = parse_integer();
|
||||||
if (width >= RTLIL::WIDTH_LIMIT)
|
if (width_val < 0 || width_val >= RTLIL::WIDTH_LIMIT)
|
||||||
error("Wire width %lld out of range before `%s`.", width, error_token());
|
error("Wire width %lld out of range before `%s`.", width_val, error_token());
|
||||||
|
width = width_val;
|
||||||
}
|
}
|
||||||
else if (try_parse_keyword("upto"))
|
else if (try_parse_keyword("upto"))
|
||||||
upto = true;
|
upto = true;
|
||||||
|
|
@ -589,9 +590,10 @@ struct RTLILFrontendWorker {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (try_parse_keyword("width")){
|
if (try_parse_keyword("width")){
|
||||||
width = parse_integer();
|
long long width_val = parse_integer();
|
||||||
if (width >= RTLIL::WIDTH_LIMIT)
|
if (width_val < 0 || width_val >= RTLIL::WIDTH_LIMIT)
|
||||||
error("Memory width %lld out of range before `%s`.", width, error_token());
|
error("Memory width %lld out of range before `%s`.", width_val, error_token());
|
||||||
|
width = width_val;
|
||||||
}
|
}
|
||||||
else if (try_parse_keyword("size"))
|
else if (try_parse_keyword("size"))
|
||||||
size = parse_integer();
|
size = parse_integer();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue