From 356a09d295fa322b7d6def3550576710790c9abe Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 10 Jun 2015 11:30:58 +0200 Subject: [PATCH] vhdlpp: VTypeArray::evaluate_ranges uses range boundaries to determine the direction. --- vhdlpp/vtype.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vhdlpp/vtype.cc b/vhdlpp/vtype.cc index 4dc97199a..d2f6ad6dc 100644 --- a/vhdlpp/vtype.cc +++ b/vhdlpp/vtype.cc @@ -266,12 +266,11 @@ bool VTypeArray::is_variable_length(ScopeBase*scope) const { void VTypeArray::evaluate_ranges(ScopeBase*scope) { for(std::vector::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); } } }