Skip to content

Commit 1068a99

Browse files
Merge pull request #11 from diffblue/enable-monitor-exceptions
Enable Monitor exceptions
2 parents 3163b09 + 436b272 commit 1068a99

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/java/java/lang/Object.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public final void wait() throws InterruptedException {
110110
protected void finalize() throws Throwable { }
111111

112112
/**
113-
* This method is not present in the original Objecct class.
113+
* This method is not present in the original Object class.
114114
* It will be called by JBMC when the monitor in this instance
115115
* is being acquired as a result of either the execution of a
116116
* monitorenter bytecode instruction or the call to a synchronized
@@ -122,8 +122,8 @@ public static void monitorenter(Object object)
122122
{
123123
//FIXME: we shoud remove the call to this method from the call
124124
// stack appended to the thrown exception
125-
// if (object == null)
126-
// throw new NullPointerException();
125+
if (object == null)
126+
throw new NullPointerException();
127127

128128
CProver.atomicBegin();
129129
// this assume blocks this execution path in JBMC and simulates
@@ -134,7 +134,7 @@ public static void monitorenter(Object object)
134134
}
135135

136136
/**
137-
* This method is not present in the original Objecct class.
137+
* This method is not present in the original Object class.
138138
* It will be called by JBMC when the monitor in this instance
139139
* is being released as a result of either the execution of a
140140
* monitorexit bytecode instruction or the return (normal or exceptional)
@@ -145,6 +145,9 @@ public static void monitorexit(Object object)
145145
{
146146
//FIXME: we shoud remove the call to this method from the call
147147
// stack appended to the thrown exception
148+
// FIXME: Enabling these exceptions makes
149+
// jbmc-regression/synchronized-blocks/test_sync.desc
150+
// run into an infinite loop during symex
148151
// if (object == null)
149152
// throw new NullPointerException();
150153

0 commit comments

Comments
 (0)