Skip to content

Commit 5cd01ab

Browse files
committed
Test for unbalanced stack due to loading two values from outside.
1 parent 419ab92 commit 5cd01ab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/libsolidity/SolidityNameAndTypeResolution.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -4852,6 +4852,19 @@ BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_negative_stack)
48524852
CHECK_WARNING(text, "Inline assembly block is not balanced");
48534853
}
48544854

4855+
BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_two_stack_load)
4856+
{
4857+
char const* text = R"(
4858+
contract c {
4859+
uint8 x;
4860+
function f() {
4861+
assembly { x pop }
4862+
}
4863+
}
4864+
)";
4865+
CHECK_WARNING(text, "Inline assembly block is not balanced");
4866+
}
4867+
48554868
BOOST_AUTO_TEST_CASE(inline_assembly_in_modifier)
48564869
{
48574870
char const* text = R"(

0 commit comments

Comments
 (0)