vhdlpp: VTypeArray::evaluate_ranges uses range boundaries to determine the direction.

This commit is contained in:
Maciej Suminski 2015-06-10 11:30:58 +02:00
parent 47c5ce0ab6
commit 356a09d295
1 changed files with 1 additions and 2 deletions

View File

@ -266,12 +266,11 @@ bool VTypeArray::is_variable_length(ScopeBase*scope) const {
void VTypeArray::evaluate_ranges(ScopeBase*scope) {
for(std::vector<range_t>::iterator it = ranges_.begin(); it != ranges_.end(); ++it ) {
int64_t lsb_val = -1, msb_val = -1;
bool dir = it->is_downto();
if(it->msb()->evaluate(scope, msb_val) && it->lsb()->evaluate(scope, lsb_val)) {
assert(lsb_val >= 0);
assert(msb_val >= 0);
*it = range_t(new ExpInteger(msb_val), new ExpInteger(lsb_val), dir);
*it = range_t(new ExpInteger(msb_val), new ExpInteger(lsb_val), msb_val > lsb_val);
}
}
}