Fix const property initialization in derived classes
Property indices include the properties inherited from base classes. `netclass_t::get_prop_initialized()` currently uses this combined index without removing the inherited property count when accessing the local property table. This can read past the table and treat a derived const property as already initialized. Subtract the inherited property count, matching the other property accessors. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
f493076882
commit
6e2c7f352e
|
|
@ -136,7 +136,7 @@ bool netclass_t::get_prop_initialized(size_t idx) const
|
|||
if (idx < super_size)
|
||||
return super_->get_prop_initialized(idx);
|
||||
else
|
||||
return property_table_[idx].initialized_flag;
|
||||
return property_table_[idx-super_size].initialized_flag;
|
||||
}
|
||||
|
||||
void netclass_t::set_prop_initialized(size_t idx) const
|
||||
|
|
|
|||
Loading…
Reference in New Issue