Skip to content

Fix a few places where a null pointer may be dereferenced #1470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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