forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add org.cprover.MustNotThrow method attribute
This asserts that a particular method must not throw exceptions, intended for use with internal methods such as cproverNondetInitialize, which must not propagate exceptions to their callsite. In such a case, instead of an exception dispatch table we introduce an assumption checking one was not in fact thrown.
- Loading branch information
Showing
8 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
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,17 @@ | ||
public class Test { | ||
|
||
@org.cprover.MustNotThrow | ||
public static void mustNotThrow() { | ||
throw new RuntimeException("Oh dear"); | ||
} | ||
|
||
public static void main() { | ||
try { | ||
mustNotThrow(); | ||
} | ||
catch(Throwable e) { | ||
assert false; | ||
} | ||
} | ||
|
||
} |
Binary file added
BIN
+156 Bytes
jbmc/regression/jbmc/must-not-throw-annotation/org/cprover/MustNotThrow.class
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
jbmc/regression/jbmc/must-not-throw-annotation/org/cprover/MustNotThrow.java
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,3 @@ | ||
package org.cprover; | ||
|
||
public @interface MustNotThrow { } |
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,8 @@ | ||
CORE | ||
Test.class | ||
--function Test.main | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
^warning: ignoring |
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