Skip to content

Java bytecode typecheck: assert -> invariant #1505

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 24, 2017
Merged
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
8 changes: 4 additions & 4 deletions src/java_bytecode/java_bytecode_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ void java_bytecode_typecheckt::typecheck_expr(exprt &expr)

void java_bytecode_typecheckt::typecheck_expr_java_new(side_effect_exprt &expr)
{
assert(expr.operands().empty());
PRECONDITION(expr.operands().empty());
typet &type=expr.type();
typecheck_type(type);
}

void java_bytecode_typecheckt::typecheck_expr_java_new_array(
side_effect_exprt &expr)
{
assert(expr.operands().size()>=1); // one per dimension
PRECONDITION(expr.operands().size()>=1); // one per dimension
typet &type=expr.type();
typecheck_type(type);
}
Expand Down Expand Up @@ -225,7 +225,7 @@ void java_bytecode_typecheckt::typecheck_expr_symbol(symbol_exprt &expr)

if(s_it==symbol_table.symbols.end())
{
assert(has_prefix(id2string(identifier), "java::"));
PRECONDITION(has_prefix(id2string(identifier), "java::"));

// no, create the symbol
symbolt new_symbol;
Expand Down Expand Up @@ -254,7 +254,7 @@ void java_bytecode_typecheckt::typecheck_expr_symbol(symbol_exprt &expr)
else
{
// yes!
assert(!s_it->second.is_type);
INVARIANT(!s_it->second.is_type, "symbol identifier should not be a type");

const symbolt &symbol=s_it->second;

Expand Down