File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Bugfixes:
11
11
* Commandline interface: Do not try creating paths `` . `` and `` .. `` .
12
12
* Type system: Fix a crash caused by continuing on fatal errors in the code.
13
13
* Type system: Disallow arrays with negative length.
14
+ * Inline assembly: Charge one stack slot for non-value types during analysis.
14
15
15
16
### 0.4.9 (2017-01-31)
16
17
Original file line number Diff line number Diff line change @@ -611,7 +611,7 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
611
611
fatalTypeError (SourceLocation (), " Constant variables not yet implemented for inline assembly." );
612
612
if (var->isLocalVariable ())
613
613
pushes = var->type ()->sizeOnStack ();
614
- else if (var->type ()->isValueType ())
614
+ else if (! var->type ()->isValueType ())
615
615
pushes = 1 ;
616
616
else
617
617
pushes = 2 ; // slot number, intra slot offset
Original file line number Diff line number Diff line change @@ -4852,6 +4852,19 @@ BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_negative_stack)
4852
4852
CHECK_WARNING (text, " Inline assembly block is not balanced" );
4853
4853
}
4854
4854
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
+
4855
4868
BOOST_AUTO_TEST_CASE (inline_assembly_in_modifier)
4856
4869
{
4857
4870
char const * text = R"(
You can’t perform that action at this time.
0 commit comments