Skip to content

Commit 7112b11

Browse files
authored
Merge pull request #4286 from The-OpenROAD-Project-staging/secure-fix_extract_design
Fix logic to extract design stage
2 parents 6114fbb + f853b11 commit 7112b11

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

flow/scripts/util.tcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ proc recover_power_helper { } {
7474
}
7575

7676
proc extract_stage { input_file } {
77-
if { ![regexp {/([0-9])_(([0-9])_)?} $input_file match num1 _ num2] } {
77+
# Match the stage prefix on the basename, not the full path: an ancestor
78+
# dir like ".../4_something/3_place.odb" would otherwise match "4_" -> stage 4.
79+
set stage_file [file tail $input_file]
80+
if { ![regexp {^([0-9])_(?:([0-9])_)?} $stage_file match num1 num2] } {
7881
puts "Error: Could not determine design stage from $input_file"
7982
exit 1
8083
}

0 commit comments

Comments
 (0)