From 767ec1d670808cd479ac74780bff51a1f1900f04 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 1 Dec 2016 12:12:10 +0000 Subject: Support explicit conversion of external function type to address --- libsolidity/codegen/ContractCompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/codegen/ContractCompiler.cpp') diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 4d33927d..f4279906 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -42,7 +42,7 @@ class StackHeightChecker public: StackHeightChecker(CompilerContext const& _context): m_context(_context), stackHeight(m_context.stackHeight()) {} - void check() { solAssert(m_context.stackHeight() == stackHeight, "I sense a disturbance in the stack."); } + void check() { solAssert(m_context.stackHeight() == stackHeight, "I sense a disturbance in the stack. "); } private: CompilerContext const& m_context; unsigned stackHeight; -- cgit v1.2.3 From ce62c7c01c01c859f6b310309a186a966e835d77 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 2 Dec 2016 13:58:14 +0000 Subject: Be more verbose on the stack-mismatch errors --- libsolidity/codegen/ContractCompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/codegen/ContractCompiler.cpp') diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index f4279906..9d6129a3 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -42,7 +42,7 @@ class StackHeightChecker public: StackHeightChecker(CompilerContext const& _context): m_context(_context), stackHeight(m_context.stackHeight()) {} - void check() { solAssert(m_context.stackHeight() == stackHeight, "I sense a disturbance in the stack. "); } + void check() { solAssert(m_context.stackHeight() == stackHeight, std::string("I sense a disturbance in the stack: ") + std::to_string(m_context.stackHeight()) + " vs " + std::to_string(stackHeight)); } private: CompilerContext const& m_context; unsigned stackHeight; -- cgit v1.2.3 From 586d156f33c78469f3272b4e8b8eae4f6229d04e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 8 Feb 2017 23:16:47 +0000 Subject: Use the REVERT opcode for throw; --- libsolidity/codegen/ContractCompiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libsolidity/codegen/ContractCompiler.cpp') diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 9d6129a3..6524bd03 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -762,7 +762,9 @@ bool ContractCompiler::visit(Return const& _return) bool ContractCompiler::visit(Throw const& _throw) { CompilerContext::LocationSetter locationSetter(m_context, _throw); - m_context.appendJumpTo(m_context.errorTag()); + // Do not send back an error detail. + m_context << u256(0) << u256(0); + m_context << Instruction::REVERT; return false; } -- cgit v1.2.3