From 811bb770c51bc63f9ccb2bff014482ba9c760132 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 16 Feb 2017 15:49:59 +0100 Subject: Change effect of assert to invalid opcode. --- libsolidity/codegen/ExpressionCompiler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libsolidity') diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 2ed19a83..41cfcb69 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -875,9 +875,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) // jump if condition was met m_context << Instruction::ISZERO << Instruction::ISZERO; auto success = m_context.appendConditionalJump(); - // condition was not met, abort - m_context << u256(0) << u256(0); - m_context << Instruction::REVERT; + // condition was not met, flag an error + m_context << Instruction::INVALID; // the success branch m_context << success; break; -- cgit From 4b1e8111cc2469808d08e1718d3edd64b2cc4484 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 23 Feb 2017 19:42:38 +0100 Subject: Remove assert for now. --- libsolidity/analysis/GlobalContext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libsolidity') diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp index 4f100cd0..069d10f5 100644 --- a/libsolidity/analysis/GlobalContext.cpp +++ b/libsolidity/analysis/GlobalContext.cpp @@ -66,8 +66,9 @@ m_magicVariables(vector>{make_shared< make_shared(strings{"bytes32", "uint8", "bytes32", "bytes32"}, strings{"address"}, FunctionType::Location::ECRecover)), make_shared("ripemd160", make_shared(strings(), strings{"bytes20"}, FunctionType::Location::RIPEMD160, true)), - make_shared("assert", - make_shared(strings{"bool"}, strings{}, FunctionType::Location::Assert)), +// Disabled until decision about semantics of assert is made. +// make_shared("assert", +// make_shared(strings{"bool"}, strings{}, FunctionType::Location::Assert)), make_shared("revert", make_shared(strings(), strings(), FunctionType::Location::Revert))}) { -- cgit