Skip to content

Commit c982c21

Browse files
author
Thomas Kiley
authored
Merge pull request #2486 from Degiorgio/jbmc-synchronoization-asymmetry-fix
JBMC: Fixed asymmetry between synchronized blocks and methods.
2 parents 610467e + da76500 commit c982c21

File tree

14 files changed

+54
-14
lines changed

14 files changed

+54
-14
lines changed

jbmc/regression/jbmc-concurrency/synchronized-blocks-illegal-state/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
KNOWNBUG
22
Sync.class
3-
--lazy-methods --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
3+
--lazy-methods --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --java-threading
44
^VERIFICATION SUCCESSFUL$
55
^EXIT=0$
66
^SIGNAL=0$

jbmc/regression/jbmc-concurrency/synchronized-blocks-null-throw/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
KNOWNBUG
22
Sync.class
3-
--cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
3+
--cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --java-threading
44
^VERIFICATION SUCCESSFUL$
55
--
66
^warning: ignoring

jbmc/regression/jbmc-concurrency/synchronized-blocks-throw/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
KNOWNBUG
22
Sync.class
3-
--cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --lazy-methods
3+
--cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --lazy-methods --java-threading
44
^VERIFICATION SUCCESSFUL$
55
--
66
^warning: ignoring
Binary file not shown.

jbmc/regression/jbmc-concurrency/synchronized-blocks/A.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ public void me0()
1414
}
1515
}
1616

17+
// expected verification success
18+
public static void aStatic() throws java.io.IOException
19+
{
20+
Object _lock = new Object();
21+
try
22+
{
23+
synchronized (_lock)
24+
{
25+
if(true)
26+
throw new java.io.IOException();
27+
}
28+
}
29+
catch (java.io.IOException e)
30+
{
31+
return;
32+
}
33+
assert false; // unreachable
34+
}
35+
1736
// expected verification success
1837
// --
1938
// base-case, no synchronization
Binary file not shown.

jbmc/regression/jbmc-concurrency/synchronized-blocks/test1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
A.class
3-
--function 'A.me0:()V' --lazy-methods --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --show-goto-functions
3+
--function 'A.me0:()V' --lazy-methods --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --show-goto-functions --java-threading
44
ATOMIC_BEGIN
55
ATOMIC_END
66
--

jbmc/regression/jbmc-concurrency/synchronized-blocks/test2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
A.class
3-
--function 'A.me0:()V' --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar`
3+
--function 'A.me0:()V' --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --java-threading
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

jbmc/regression/jbmc-concurrency/synchronized-blocks/test3.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
A.class
3-
--function 'A.me0:()V' --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --lazy-methods
3+
--function 'A.me0:()V' --cp `../../../../scripts/format_classpath.sh . ../../../src/java_bytecode/library/core-models.jar` --lazy-methods --java-threading
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
A.class
3+
--function 'A.aStatic' --lazy-methods
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
Tests that throwing an exception from a synchronization blocks does not cause reachability issues when the java-threading flag is not specified.
10+

0 commit comments

Comments
 (0)