diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-12-01 18:58:34 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-12-01 18:58:34 +0800 |
commit | e29047b24d149e6b27962f9fe89e8275e213c11d (patch) | |
tree | 632d05a126d528b9d2d1e3c87df1141ff48dfbbf /libsolidity | |
parent | 67f274f66c65058c784e610767144cfe32a7dd2c (diff) | |
download | dexon-solidity-e29047b24d149e6b27962f9fe89e8275e213c11d.tar.gz dexon-solidity-e29047b24d149e6b27962f9fe89e8275e213c11d.tar.zst dexon-solidity-e29047b24d149e6b27962f9fe89e8275e213c11d.zip |
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.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 437c484a..124546de 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -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(); |