mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix source location of yul variable declarations without value.
This commit is contained in:
parent
efd2f63c2c
commit
7da453014d
@ -18,6 +18,7 @@ Bugfixes:
|
|||||||
* Type Checker: Disallow accessing ``runtimeCode`` for contract types that contain immutable state variables.
|
* Type Checker: Disallow accessing ``runtimeCode`` for contract types that contain immutable state variables.
|
||||||
* Fixed an "Assembly Exception in Bytecode" error where requested functions were generated twice.
|
* Fixed an "Assembly Exception in Bytecode" error where requested functions were generated twice.
|
||||||
* Natspec: Fixed a bug that ignored ``@return`` tag when no other developer-documentation tags were present.
|
* Natspec: Fixed a bug that ignored ``@return`` tag when no other developer-documentation tags were present.
|
||||||
|
* Yul assembler: Fix source location of variable declarations without value.
|
||||||
|
|
||||||
|
|
||||||
### 0.6.7 (2020-05-04)
|
### 0.6.7 (2020-05-04)
|
||||||
|
@ -184,11 +184,13 @@ void CodeTransform::operator()(VariableDeclaration const& _varDecl)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
m_assembly.setSourceLocation(_varDecl.location);
|
||||||
int variablesLeft = numVariables;
|
int variablesLeft = numVariables;
|
||||||
while (variablesLeft--)
|
while (variablesLeft--)
|
||||||
m_assembly.appendConstant(u256(0));
|
m_assembly.appendConstant(u256(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_assembly.setSourceLocation(_varDecl.location);
|
||||||
bool atTopOfStack = true;
|
bool atTopOfStack = true;
|
||||||
for (int varIndex = numVariables - 1; varIndex >= 0; --varIndex)
|
for (int varIndex = numVariables - 1; varIndex >= 0; --varIndex)
|
||||||
{
|
{
|
||||||
@ -203,7 +205,6 @@ void CodeTransform::operator()(VariableDeclaration const& _varDecl)
|
|||||||
if (atTopOfStack)
|
if (atTopOfStack)
|
||||||
{
|
{
|
||||||
m_context->variableStackHeights.erase(&var);
|
m_context->variableStackHeights.erase(&var);
|
||||||
m_assembly.setSourceLocation(_varDecl.location);
|
|
||||||
m_assembly.appendInstruction(evmasm::Instruction::POP);
|
m_assembly.appendInstruction(evmasm::Instruction::POP);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -216,7 +217,6 @@ void CodeTransform::operator()(VariableDeclaration const& _varDecl)
|
|||||||
int slot = *m_unusedStackSlots.begin();
|
int slot = *m_unusedStackSlots.begin();
|
||||||
m_unusedStackSlots.erase(m_unusedStackSlots.begin());
|
m_unusedStackSlots.erase(m_unusedStackSlots.begin());
|
||||||
m_context->variableStackHeights[&var] = slot;
|
m_context->variableStackHeights[&var] = slot;
|
||||||
m_assembly.setSourceLocation(_varDecl.location);
|
|
||||||
if (int heightDiff = variableHeightDiff(var, varName, true))
|
if (int heightDiff = variableHeightDiff(var, varName, true))
|
||||||
m_assembly.appendInstruction(evmasm::swapInstruction(heightDiff - 1));
|
m_assembly.appendInstruction(evmasm::swapInstruction(heightDiff - 1));
|
||||||
m_assembly.appendInstruction(evmasm::Instruction::POP);
|
m_assembly.appendInstruction(evmasm::Instruction::POP);
|
||||||
|
@ -5,7 +5,7 @@ EVM assembly:
|
|||||||
mstore(0x40, 0x80)
|
mstore(0x40, 0x80)
|
||||||
/* "optimizer_user_yul/input.sol":72:77 int a */
|
/* "optimizer_user_yul/input.sol":72:77 int a */
|
||||||
0x00
|
0x00
|
||||||
/* "optimizer_user_yul/input.sol":38:487 constructor() public payable... */
|
/* "optimizer_user_yul/input.sol":152:161 let x,y,z */
|
||||||
dup1
|
dup1
|
||||||
0x00
|
0x00
|
||||||
dup1
|
dup1
|
||||||
|
Loading…
Reference in New Issue
Block a user