Skip to content

Commit 00eff3f

Browse files
authored
Merge pull request #3752 from JohnDumbell/jd/enhancement/phi_merge_explicit_exclude_extern
Tighten up global extern detection in phi_function
2 parents aba13ad + 466ac7a commit 00eff3f

File tree

8 files changed

+18
-16
lines changed

8 files changed

+18
-16
lines changed

jbmc/regression/jbmc/phi-merge_uninitialized_values/field.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+(dynamic_object|new_tmp)[0-9]+(@[0-9]+)?#0\)
9-
^.*\?\s+(dynamic_object|new_tmp)[0-9]+(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

jbmc/regression/jbmc/phi-merge_uninitialized_values/local.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+(dynamic_object|new_tmp)[0-9]+(@[0-9]+)?#0\)
9-
^.*\?\s+(dynamic_object|new_tmp)[0-9]+(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

jbmc/regression/jbmc/phi-merge_uninitialized_values/static_field.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+(dynamic_object|new_tmp)[0-9]+(@[0-9]+)?#0\)
9-
^.*\?\s+(dynamic_object|new_tmp)[0-9]+(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

regression/cbmc/phi-merge_uninitialized_values/dynamic.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+dynamic_object[0-9]+(@[0-9]+)?#0\)
9-
^.*\?\s+dynamic_object[0-9]+(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

regression/cbmc/phi-merge_uninitialized_values/global.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+global(@[0-9]+)?#0\)
9-
^.*\?\s+global(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

regression/cbmc/phi-merge_uninitialized_values/local.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+local(@[0-9]+)?#0\)
9-
^.*\?\s+local(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

regression/cbmc/phi-merge_uninitialized_values/static_local.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
77
--
8-
^.*:\s+staticLocal(@[0-9]+)?#0\)
9-
^.*\?\s+staticLocal(@[0-9]+)?#0\s+:
8+
\([^\s]+guard[^\s]+ \? [^\s]+#0 : [^\s]+\)
9+
\([^\s]+guard[^\s]+ \? [^\s]+ : [^\s]+#0\)
1010
--
1111
These regexes are making sure that a variable of generation 0 dosen't appear in a phi merge, so the below
1212
statement:

src/goto-symex/symex_goto.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,17 @@ static void merge_names(
476476
// 1. Either guard is false, so we can't follow that branch.
477477
// 2. Either identifier is of generation zero, and so hasn't been
478478
// initialized and therefore an invalid target.
479+
480+
// These rules only apply to dynamic objects and locals.
479481
if(dest_state.guard.is_false())
480482
rhs = goto_state_rhs;
481483
else if(goto_state.guard.is_false())
482484
rhs = dest_state_rhs;
483-
else if(goto_count == 0 && symbol.value.is_not_nil())
485+
else if(goto_count == 0 && !symbol.is_static_lifetime)
484486
{
485487
rhs = dest_state_rhs;
486488
}
487-
else if(dest_count == 0 && symbol.value.is_not_nil())
489+
else if(dest_count == 0 && !symbol.is_static_lifetime)
488490
{
489491
rhs = goto_state_rhs;
490492
}

0 commit comments

Comments
 (0)