OpenSTA/dcalc/test/cpp
Andreas Wendleder 0e40b4f8a1
Fix UB in dcalc tests: remove fake Pin* pointers from LoadPinIndexMap
LoadPinIndexMap uses PinIdLess as its comparator, which calls
network_->id(pin) and dereferences the Pin pointer. Three tests
created fake Pin* via reinterpret_cast<const Pin*>(&int_var) and
inserted them into LoadPinIndexMap, causing undefined behavior.

With GCC 15.2.0's hardened std::vector::operator[] bounds checking,
this UB manifests as an assertion failure:
  vector::operator[]: Assertion '__n < this->size()' failed

Fix by using empty LoadPinIndexMap for gateDelay/gateDelays/
inputPortDelay calls (the comparator is never invoked on an empty
map) and testing wire delay/load slew accessors via
ArcDcalcResult::setLoadCount() directly.
2026-04-13 15:35:10 +02:00
..
CMakeLists.txt test: Add comprehensive test infrastructure and test cases across all OpenSTA modules 2026-02-27 12:59:25 +09:00
TestDcalc.cc Fix UB in dcalc tests: remove fake Pin* pointers from LoadPinIndexMap 2026-04-13 15:35:10 +02:00
TestFindRoot.cc latest STA plus changes to fix prima dcalc and read_spef issues, TCL regression added 2026-04-07 20:48:15 +00:00