Do not require payable for callvalue instruction.

This commit is contained in:
chriseth 2019-05-22 11:30:29 +02:00
parent f06582f97f
commit 7506b5752a
6 changed files with 4 additions and 5 deletions

View File

@ -11,6 +11,7 @@ Compiler Features:
* SMTChecker: Support tuples and function calls with multiple return values.
* SMTChecker: Support ``delete``.
* SMTChecker: Inline external function calls to ``this``.
* Inline Assembly: Revert change introduced in 0.5.7: The ``callvalue()`` instruction does not require ``payable`` anymore.
* Metadata: Add IPFS hashes of source files.
* Assembler: Encode the compiler version in the deployed bytecode.
* Yul Optimizer: Simplify single-run ``for`` loops to ``if`` statements.

View File

@ -112,8 +112,6 @@ private:
{
if (eth::SemanticInformation::invalidInViewFunctions(_instruction))
m_reportMutability(StateMutability::NonPayable, _location);
else if (_instruction == dev::eth::Instruction::CALLVALUE)
m_reportMutability(StateMutability::Payable, _location);
else if (eth::SemanticInformation::invalidInPureFunctions(_instruction))
m_reportMutability(StateMutability::View, _location);
}

View File

@ -8,4 +8,3 @@ contract C
}
}
// ----
// TypeError: (92-103): "msg.value" and "callvalue()" can only be used in payable public functions. Make the function "payable" or use an internal function to avoid this error.

View File

@ -7,4 +7,4 @@ contract C
}
}
// ----
// TypeError: (81-92): "msg.value" and "callvalue()" can only be used in payable public functions. Make the function "payable" or use an internal function to avoid this error.
// Warning: (17-108): Function state mutability can be restricted to view

View File

@ -9,3 +9,5 @@ contract C
return f();
}
}
// ----
// Warning: (17-121): Function state mutability can be restricted to view

View File

@ -11,4 +11,3 @@ contract C
}
}
// ----
// TypeError: (99-100): This modifier uses "msg.value" or "callvalue()" and thus the function has to be payable or internal.