codegen: assertion did not assert non-nullness

This commit strengthens an assertion so that it makes sure that a pointer is not null.
Moreover, `isLocalVariable(variable)` is now positively asserted, following the error message.
This commit is contained in:
Yoichi Hirai 2016-12-01 11:58:34 +01:00
parent 67f274f66c
commit e29047b24d
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -583,7 +583,7 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
// lvalue context
auto variable = dynamic_cast<VariableDeclaration const*>(decl);
solAssert(
!!variable || !m_context.isLocalVariable(variable),
!!variable && m_context.isLocalVariable(variable),
"Can only assign to stack variables in inline assembly."
);
unsigned size = variable->type()->sizeOnStack();