Skip to content

Commit

Permalink
Merge pull request diffblue#1470 from reuk/reuk/fix-null-dereferences
Browse files Browse the repository at this point in the history
Fix a few places where a null pointer may be dereferenced
  • Loading branch information
smowton authored Oct 11, 2017
2 parents 5fa7b9a + 0832454 commit d8b25f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/goto-programs/remove_exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(

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

// add GOTOs implementing the dynamic dispatch of the
Expand Down Expand Up @@ -387,7 +387,7 @@ void remove_exceptionst::instrument_throw(

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

// add the assignment with the appropriate cast
Expand Down
4 changes: 2 additions & 2 deletions src/java_bytecode/java_bytecode_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ void java_bytecode_typecheckt::typecheck_expr_member(member_exprt &expr)
{
// member doesn't exist. In this case struct_type should be an opaque
// stub, and we'll add the member to it.
symbolt &symbol_table_type=
*symbol_table.get_writeable("java::"+id2string(struct_type.get_tag()));
symbolt &symbol_table_type=symbol_table.get_writeable_ref(
"java::"+id2string(struct_type.get_tag()));
auto &add_to_components=
to_struct_type(symbol_table_type.type).components();
add_to_components
Expand Down

0 comments on commit d8b25f3

Please sign in to comment.