mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Checks for uninitialized access to calldata variables.
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
function f(uint[] calldata _c) public pure {
|
||||
uint[] calldata c;
|
||||
if (_c[2] > 10)
|
||||
c = _c;
|
||||
c[2];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (141-142): This variable is of calldata pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
Reference in New Issue
Block a user