From 4e2df9d69c04b24d3c3cbd2b47ebc8e0416fbde2 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 10 Oct 2021 17:59:11 -0700 Subject: [PATCH] [Lib] Bug fix in unintialized memory in fabric key --- libopenfpga/libfabrickey/src/fabric_key.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libopenfpga/libfabrickey/src/fabric_key.cpp b/libopenfpga/libfabrickey/src/fabric_key.cpp index f17f3deaa..500dec09a 100644 --- a/libopenfpga/libfabrickey/src/fabric_key.cpp +++ b/libopenfpga/libfabrickey/src/fabric_key.cpp @@ -91,6 +91,10 @@ std::vector FabricKey::wl_bank_data_ports(const FabricRegio void FabricKey::reserve_regions(const size_t& num_regions) { region_ids_.reserve(num_regions); region_key_ids_.reserve(num_regions); + bl_bank_ids_.reserve(num_regions); + bl_bank_data_ports_.reserve(num_regions); + wl_bank_ids_.reserve(num_regions); + wl_bank_data_ports_.reserve(num_regions); } FabricRegionId FabricKey::create_region() { @@ -98,6 +102,10 @@ FabricRegionId FabricKey::create_region() { FabricRegionId region = FabricRegionId(region_ids_.size()); region_ids_.push_back(region); region_key_ids_.emplace_back(); + bl_bank_ids_.emplace_back(); + bl_bank_data_ports_.emplace_back(); + wl_bank_ids_.emplace_back(); + wl_bank_data_ports_.emplace_back(); return region; }