From 8c8def6b3c3af33c1faf5fc04e6341c9419ac188 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 28 Jan 2015 18:19:01 +0100 Subject: [PATCH] Fix stack size of typetypes. --- SolidityEndToEndTest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index 23cd4f6d8..6c7b75027 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -1877,6 +1877,22 @@ BOOST_AUTO_TEST_CASE(use_std_lib) BOOST_CHECK(m_state.balance(m_sender) > balanceBefore); } +BOOST_AUTO_TEST_CASE(crazy_elementary_typenames_on_stack) +{ + char const* sourceCode = R"( + contract C { + function f() returns (uint r) { + uint; uint; uint; uint; + int x = -7; + var a = uint; + return a(x); + } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(-7))); +} + BOOST_AUTO_TEST_SUITE_END() }