solidity/test/libsolidity/syntaxTests/controlFlow/storageReturn/dowhile_warn.sol

53 lines
2.0 KiB
Solidity
Raw Normal View History

contract C {
struct S { bool f; }
S s;
function f() internal view returns (S storage c) {
do {
break;
c = s;
} while(false);
}
function g() internal view returns (S storage c) {
do {
if (s.f) {
continue;
c = s;
}
else {
}
} while(false);
}
function h() internal view returns (S storage c) {
do {
if (s.f) {
break;
2018-05-15 12:19:40 +00:00
}
else {
c = s;
}
} while(false);
}
function i() internal view returns (S storage c) {
do {
if (s.f) {
continue;
}
else {
c = s;
}
} while(false);
}
2018-05-15 12:19:40 +00:00
function j() internal view returns (S storage c) {
do {
continue;
c = s;
} while(false);
}
}
// ----
// Warning: (87-98): This variable is of storage pointer type and might be returned without assignment. This can cause storage corruption. Assign the variable (potentially from itself) to remove this warning.
// Warning: (223-234): This variable is of storage pointer type and might be returned without assignment. This can cause storage corruption. Assign the variable (potentially from itself) to remove this warning.
// Warning: (440-451): This variable is of storage pointer type and might be returned without assignment. This can cause storage corruption. Assign the variable (potentially from itself) to remove this warning.
2018-05-15 12:19:40 +00:00
// Warning: (654-665): This variable is of storage pointer type and might be returned without assignment. This can cause storage corruption. Assign the variable (potentially from itself) to remove this warning.
// Warning: (871-882): This variable is of storage pointer type and might be returned without assignment. This can cause storage corruption. Assign the variable (potentially from itself) to remove this warning.