mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallowing usage of msg.data in receive() function.
This commit is contained in:
@@ -224,6 +224,17 @@ bool StaticAnalyzer::visit(MemberAccess const& _memberAccess)
|
||||
"Because of that, it might be that the deployed bytecode is different from type(...).runtimeCode."
|
||||
);
|
||||
}
|
||||
else if (
|
||||
m_currentFunction &&
|
||||
m_currentFunction->isReceive() &&
|
||||
type->kind() == MagicType::Kind::Message &&
|
||||
_memberAccess.memberName() == "data"
|
||||
)
|
||||
m_errorReporter.typeError(
|
||||
7139_error,
|
||||
_memberAccess.location(),
|
||||
R"("msg.data" cannot be used inside of "receive" function.)"
|
||||
);
|
||||
}
|
||||
|
||||
if (_memberAccess.memberName() == "callcode")
|
||||
|
||||
Reference in New Issue
Block a user