@@ -160,7 +160,10 @@ class java_bytecode_convertt:public messaget
160160 exprt::operandst pop (unsigned n)
161161 {
162162 if (stack.size ()<n)
163- throw " malformed bytecode (pop too high)" ;
163+ {
164+ error () << " malformed bytecode (pop too high)" << eom;
165+ throw 0 ;
166+ }
164167
165168 exprt::operandst operands;
166169 operands.resize (n);
@@ -188,7 +191,7 @@ class java_bytecode_convertt:public messaget
188191 codet convert_instructions (
189192 const instructionst &, const code_typet &);
190193
191- static const bytecode_infot &get_bytecode_info (const irep_idt &statement);
194+ const bytecode_infot &get_bytecode_info (const irep_idt &statement);
192195
193196 void generate_class_stub (const irep_idt &class_name);
194197 void add_array_types ();
@@ -249,7 +252,10 @@ void java_bytecode_convertt::convert(const classt &c)
249252
250253 // add before we do members
251254 if (symbol_table.move (new_symbol, class_symbol))
252- throw " failed to add class symbol " +id2string (new_symbol.name );
255+ {
256+ error () << " failed to add class symbol " << new_symbol.name << eom;
257+ throw 0 ;
258+ }
253259
254260 // now do members
255261 for (const auto & it : c.fields )
@@ -542,7 +548,10 @@ void java_bytecode_convertt::convert(
542548 new_symbol.value =gen_zero (member_type);
543549
544550 if (symbol_table.add (new_symbol))
545- throw " failed to add static field symbol" ;
551+ {
552+ error () << " failed to add static field symbol" << eom;
553+ throw 0 ;
554+ }
546555 }
547556}
548557
@@ -564,8 +573,9 @@ const bytecode_infot &java_bytecode_convertt::get_bytecode_info(
564573 for (const bytecode_infot *p=bytecode_info; p->mnemonic !=0 ; p++)
565574 if (statement==p->mnemonic ) return *p;
566575
567- throw std::string (" failed to find bytecode mnemonic `" )+
568- id2string (statement)+" '" ;
576+ error () << " failed to find bytecode mnemonic `"
577+ << statement << ' \' ' << eom;
578+ throw 0 ;
569579}
570580
571581namespace {
0 commit comments