From 6e2c7f352eaffac92724af5b6f4a72840cc52731 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 6 Aug 2026 22:21:56 -0700 Subject: [PATCH] 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 --- netclass.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netclass.cc b/netclass.cc index 278fceb43..60f5f37ff 100644 --- a/netclass.cc +++ b/netclass.cc @@ -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