-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1703 from goblint/issue_1647
Fix flaky cram tests where `vid`s leak into witnesses
- Loading branch information
Showing
3 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments are provided | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <file>" | ||
exit 1 | ||
fi | ||
|
||
file="$1" | ||
|
||
# Function to extract the first and second occurrences of the pattern | ||
extract_variables() { | ||
grep -o -m 2 'alloc_m[0-9]\+_locked' "$1" | ||
} | ||
|
||
# Extract variables from the file | ||
var1=$(extract_variables "$file" | sed -n '1p') | ||
var2=$(extract_variables "$file" | sed -n '2p') | ||
|
||
# Check if both variables were found | ||
if [ -z "$var1" ] || [ -z "$var2" ]; then | ||
echo "Error: Could not find two occurrences of the pattern 'alloc_m[0-9]+_locked' in the file." | ||
exit 1 | ||
fi | ||
|
||
# Rename variables and print the modified file to stdout | ||
sed -e "s/$var1/ALLOC_VAR1_LOCKED/g" -e "s/$var2/ALLOC_VAR2_LOCKED/g" "$file" |