1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-05-08 08:42:23 +00:00

himbaechel: bounds check getBelByLocation

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat
2026-05-04 13:38:04 +02:00
parent 92c392f5f5
commit fcc80c5332

View File

@@ -513,6 +513,8 @@ struct Arch : BaseArch<ArchRanges>
}
BelId getBelByLocation(Loc loc) const override
{
if (loc.x < 0 || loc.x >= chip_info->width || loc.y < 0 || loc.y >= chip_info->height)
return BelId();
int tile = tile_by_xy(chip_info, loc.x, loc.y);
auto &tile_data = chip_tile_info(chip_info, tile);
for (size_t i = 0; i < tile_data.bels.size(); i++) {