Skip to content

Commit 8f629b6

Browse files
Addressed reviewers comments
1 parent bb9c28a commit 8f629b6

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed
Binary file not shown.

regression/cbmc-java/exceptions19/exception_handler.j

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
invokespecial java/lang/Exception.<init>()V
1818
athrow
1919
start:
20-
nop
20+
dup
2121
end:
2222
astore_1
2323
return

src/java_bytecode/java_bytecode_convert_method.cpp

+5-15
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ void java_bytecode_convert_methodt::convert(
473473

474474
tmp_vars.clear();
475475
if((!m.is_abstract) && (!m.is_native))
476-
method_symbol.value=convert_instructions(m, code_type);
476+
method_symbol.value=convert_instructions(
477+
m, code_type, method_symbol.name);
477478

478479
// Replace the existing stub symbol with the real deal:
479480
const auto s_it=symbol_table.symbols.find(method.get_name());
@@ -1120,7 +1121,8 @@ Function: java_bytecode_convert_methodt::convert_instructions
11201121

11211122
codet java_bytecode_convert_methodt::convert_instructions(
11221123
const methodt &method,
1123-
const code_typet &method_type)
1124+
const code_typet &method_type,
1125+
const irep_idt &method_name)
11241126
{
11251127
const instructionst &instructions=method.instructions;
11261128

@@ -1316,17 +1318,9 @@ codet java_bytecode_convert_methodt::convert_instructions(
13161318
stack.clear();
13171319
auxiliary_symbolt new_symbol;
13181320
new_symbol.is_static_lifetime=true;
1319-
int file_name_length=
1320-
id2string(method.source_location.get_file()).size();
1321-
// remove the file extension
1322-
const std::string &file_name=
1323-
id2string(method.source_location.get_file()).
1324-
substr(0, file_name_length-5);
13251321
// generate the name of the exceptional return variable
13261322
const std::string &exceptional_var_name=
1327-
"java::"+file_name+"."+
1328-
id2string(method.name)+":"+
1329-
id2string(method.signature)+
1323+
id2string(method_name)+
13301324
EXC_SUFFIX;
13311325
new_symbol.base_name=exceptional_var_name;
13321326
new_symbol.name=exceptional_var_name;
@@ -2397,10 +2391,6 @@ codet java_bytecode_convert_methodt::convert_instructions(
23972391
results[1]=op[0];
23982392
results[0]=op[1];
23992393
}
2400-
else if(statement=="nop")
2401-
{
2402-
c=code_skipt();
2403-
}
24042394
else
24052395
{
24062396
c=codet(statement);

src/java_bytecode/java_bytecode_convert_method_class.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ class java_bytecode_convert_methodt:public messaget
214214

215215
codet convert_instructions(
216216
const methodt &,
217-
const code_typet &);
217+
const code_typet &,
218+
const irep_idt &);
218219

219220
const bytecode_infot &get_bytecode_info(const irep_idt &statement);
220221

src/java_bytecode/java_entry_point.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ bool java_entry_point(
594594
// add the exceptional return value
595595
auxiliary_symbolt exc_symbol;
596596
exc_symbol.mode=ID_C;
597-
exc_symbol.is_static_lifetime=false;
597+
exc_symbol.is_static_lifetime=true;
598598
exc_symbol.name=id2string(symbol.name)+EXC_SUFFIX;
599599
exc_symbol.base_name=id2string(symbol.name)+EXC_SUFFIX;
600600
exc_symbol.type=typet(ID_pointer, empty_typet());

0 commit comments

Comments
 (0)