Checks for uninitialized access to calldata variables.

This commit is contained in:
chriseth
2020-05-26 10:51:13 +02:00
parent fb40a8abb8
commit 33450619b1
4 changed files with 45 additions and 2 deletions
@@ -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.