Skip to content

Commit 055ee6c

Browse files
committed
Fixed a memory corruption issue by copying PinSet
Signed-off-by: Jaehyun Kim <[email protected]>
1 parent 781f8c6 commit 055ee6c

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

src/rsz/src/RepairDesign.cc

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -402,28 +402,33 @@ void RepairDesign::repairDesign(
402402
}
403403
}
404404
if (slew_viol) {
405-
PinSet* drivers = network_->drivers(vertex->pin());
406-
for (const Pin* drvr_pin : *drivers) {
407-
debugPrint(logger_,
408-
RSZ,
409-
"repair_design",
410-
2,
411-
"last pass: drvr {} has slew {} vs. limit {}",
412-
sdc_network_->pathName(drvr_pin),
413-
delayAsString(actual, this, 3),
414-
delayAsString(limit, this, 3));
415-
repairDriver(graph_->pinDrvrVertex(drvr_pin),
416-
true /* check_slew */,
417-
false /* check_cap */,
418-
false /* check_fanout */,
419-
0 /* max_length */,
420-
true /* resize_driver */,
421-
corner,
422-
repaired_net_count2,
423-
slew_violations2,
424-
cap_violations,
425-
fanout_violations,
426-
length_violations);
405+
PinSet* drivers_ptr = network_->drivers(vertex->pin());
406+
if (drivers_ptr) {
407+
// Copy PinSet because repairDriver() can invalidate the
408+
// drivers_ptr by invalidating net_drvr_pin_map_ cache.
409+
PinSet drivers = *drivers_ptr;
410+
for (const Pin* drvr_pin : drivers) {
411+
debugPrint(logger_,
412+
RSZ,
413+
"repair_design",
414+
2,
415+
"last pass: drvr {} has slew {} vs. limit {}",
416+
sdc_network_->pathName(drvr_pin),
417+
delayAsString(actual, this, 3),
418+
delayAsString(limit, this, 3));
419+
repairDriver(graph_->pinDrvrVertex(drvr_pin),
420+
true /* check_slew */,
421+
false /* check_cap */,
422+
false /* check_fanout */,
423+
0 /* max_length */,
424+
true /* resize_driver */,
425+
corner,
426+
repaired_net_count2,
427+
slew_violations2,
428+
cap_violations,
429+
fanout_violations,
430+
length_violations);
431+
}
427432
}
428433
}
429434
}

0 commit comments

Comments
 (0)