Skip to content

Commit 0a61c88

Browse files
Make sure code_typet always has parameters property
The existence of the parameters property may depend on whether parameters() has been called or not, which can lead to unexpectedly unequal instructions in goto programs.
1 parent e0a5142 commit 0a61c88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

jbmc/src/java_bytecode/java_static_initializers.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,6 @@ static void create_clinit_wrapper_symbols(
295295
symbolt wrapper_method_symbol;
296296
code_typet wrapper_method_type;
297297
wrapper_method_type.return_type() = void_typet();
298-
// Ensure the parameters property is there
299-
// to avoid trouble in irept comparisons
300-
wrapper_method_type.parameters();
301298
wrapper_method_symbol.name = clinit_wrapper_name(class_name);
302299
wrapper_method_symbol.pretty_name = wrapper_method_symbol.name;
303300
wrapper_method_symbol.base_name = "clinit_wrapper";

src/util/std_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,9 @@ class code_typet:public typet
760760
public:
761761
code_typet():typet(ID_code)
762762
{
763+
// make sure this property is always there to avoid problems
764+
// with irept comparisons
765+
add(ID_parameters);
763766
}
764767

765768
// used to be argumentt -- now uses standard terminology

0 commit comments

Comments
 (0)