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.
Merge pull request diffblue#2239 from mgudemann/bugfix/generics/fix_i…
…nfinite_recursion [TG-3067] Support generic type parameters that create recursion loops in instantiation stack
- Loading branch information
Showing
17 changed files
with
473 additions
and
21 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file added
BIN
+361 Bytes
jbmc/regression/jbmc/generics_recursive_parameters/MutuallyRecursiveGenerics.class
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
jbmc/regression/jbmc/generics_recursive_parameters/MutuallyRecursiveGenerics.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,11 @@ | ||
class KeyValue<K, V> { | ||
KeyValue<K, V> next; | ||
KeyValue<V, K> reverse; | ||
K key; | ||
V value; | ||
} | ||
class MutuallyRecursiveGenerics { | ||
void f() { | ||
KeyValue<String, Integer> example1; | ||
} | ||
} |
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,9 @@ | ||
CORE | ||
MutuallyRecursiveGenerics.class | ||
--cover location --function MutuallyRecursiveGenerics.f | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
-- | ||
This failed before due to infinite recursion in the way how the instantiated | ||
generic parameters were used. cf. TG-3067 |
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
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
Binary file not shown.
Binary file added
BIN
+671 Bytes
jbmc/unit/java_bytecode/goto_program_generics/MutuallyRecursiveGenerics.class
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
jbmc/unit/java_bytecode/goto_program_generics/MutuallyRecursiveGenerics.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,29 @@ | ||
class Outer<K, V, U> { | ||
class Inner<U> { | ||
Outer<V, K, U> o; | ||
U u; | ||
} | ||
Inner<U> inner; | ||
K key; | ||
V value; | ||
} | ||
class Three<X, E, U> { | ||
Three<U, X, E> rotate; | ||
Three<X, E, U> normal; | ||
X x; | ||
E e; | ||
U u; | ||
} | ||
class KeyValue<K, V> { | ||
KeyValue<K, V> next; | ||
KeyValue<V, K> reverse; | ||
K key; | ||
V value; | ||
} | ||
class MutuallyRecursiveGenerics { | ||
KeyValue<String, Integer> example1; | ||
Three<Byte, Character, Integer> example2; | ||
Outer<Boolean, Byte, Short> example3; | ||
void f() { | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.