Fix for:
CID
1297860 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
1. Condition this->mon_addr.count(n), taking true branch
2. negative_return_fn: Function this->get_rank(n) returns a
negative number. [show details]
3. var_assign: Assigning: signed variable m = get_rank.
4. negative_returns: m is passed to a parameter that cannot be
negative.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
entity_inst_t get_inst(const string& n) {
assert(mon_addr.count(n));
int m = get_rank(n);
+ assert(m >= 0); // vector can't take negative indicies
entity_inst_t i;
i.addr = rank_addr[m];
i.name = entity_name_t::MON(m);