Skip to content

Commit d8b25f3

Browse files
authored
Merge pull request diffblue#1470 from reuk/reuk/fix-null-dereferences
Fix a few places where a null pointer may be dereferenced
2 parents 5fa7b9a + 0832454 commit d8b25f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/goto-programs/remove_exceptions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
312312

313313
// find the symbol corresponding to the caught exceptions
314314
const symbolt &exc_symbol=
315-
*symbol_table.lookup(id2string(function_id)+EXC_SUFFIX);
315+
symbol_table.lookup_ref(id2string(function_id)+EXC_SUFFIX);
316316
symbol_exprt exc_thrown=exc_symbol.symbol_expr();
317317

318318
// add GOTOs implementing the dynamic dispatch of the
@@ -387,7 +387,7 @@ void remove_exceptionst::instrument_throw(
387387

388388
// find the symbol where the thrown exception should be stored:
389389
const symbolt &exc_symbol=
390-
*symbol_table.lookup(id2string(func_it->first)+EXC_SUFFIX);
390+
symbol_table.lookup_ref(id2string(func_it->first)+EXC_SUFFIX);
391391
symbol_exprt exc_thrown=exc_symbol.symbol_expr();
392392

393393
// add the assignment with the appropriate cast

src/java_bytecode/java_bytecode_typecheck_expr.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ void java_bytecode_typecheckt::typecheck_expr_member(member_exprt &expr)
290290
{
291291
// member doesn't exist. In this case struct_type should be an opaque
292292
// stub, and we'll add the member to it.
293-
symbolt &symbol_table_type=
294-
*symbol_table.get_writeable("java::"+id2string(struct_type.get_tag()));
293+
symbolt &symbol_table_type=symbol_table.get_writeable_ref(
294+
"java::"+id2string(struct_type.get_tag()));
295295
auto &add_to_components=
296296
to_struct_type(symbol_table_type.type).components();
297297
add_to_components

0 commit comments

Comments
 (0)