aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-12-01 18:58:34 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-12-01 18:58:34 +0800
commite29047b24d149e6b27962f9fe89e8275e213c11d (patch)
tree632d05a126d528b9d2d1e3c87df1141ff48dfbbf /libsolidity
parent67f274f66c65058c784e610767144cfe32a7dd2c (diff)
downloaddexon-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.cpp2
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();