mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix error message about accessing storage pointers.
This commit is contained in:
parent
c4208a6ab8
commit
ca21659749
@ -142,7 +142,7 @@ void ControlFlowAnalyzer::checkUninitializedAccess(CFGNode const* _entry, CFGNod
|
||||
ssl,
|
||||
string("This variable is of storage pointer type and can be ") +
|
||||
(variableOccurrence->kind() == VariableOccurrence::Kind::Return ? "returned" : "accessed") +
|
||||
" without prior assignment."
|
||||
" without prior assignment, which would lead to undefined behaviour."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,4 +2,4 @@ contract C {
|
||||
function f() internal pure returns (mapping(uint=>uint) storage r) { }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (53-82): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (53-82): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -2,4 +2,4 @@ contract C {
|
||||
function f() internal pure returns (mapping(uint=>uint) storage) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (53-80): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (53-80): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -7,4 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (87-96): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (87-96): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -45,12 +45,12 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// Warning: (146-151): Unreachable code.
|
||||
// Warning: (169-174): Unreachable code.
|
||||
// TypeError: (223-234): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (223-234): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// Warning: (316-321): Unreachable code.
|
||||
// TypeError: (440-451): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (654-665): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (871-882): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (440-451): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (654-665): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (871-882): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// Warning: (933-938): Unreachable code.
|
||||
|
@ -12,5 +12,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (182-193): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (182-193): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -14,5 +14,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (96-107): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (186-197): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (96-107): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (186-197): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -18,5 +18,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (249-258): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (367-376): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (249-258): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (367-376): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -13,6 +13,6 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (176-187): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (264-275): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (176-187): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (264-275): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -9,5 +9,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (96-107): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (200-211): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (96-107): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (200-211): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment.
|
||||
// TypeError: (87-98): This variable is of storage pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (92-116): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (92-116): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -5,4 +5,4 @@ contract C {
|
||||
function f() m1(b) m2(b = s) internal view returns (uint[] storage b) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (129-130): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (129-130): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -10,4 +10,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (120-121): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (120-121): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -10,4 +10,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (120-121): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (120-121): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -7,4 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (94-95): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (94-95): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (109-110): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (109-110): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
@ -8,9 +8,9 @@ library L {
|
||||
function i(uint[] calldata, uint[] storage) external pure returns (S storage x) {return x; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (197-198): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (203-204): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (359-360): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (365-366): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (460-461): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (557-558): This variable is of storage pointer type and can be accessed without prior assignment.
|
||||
// TypeError: (197-198): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (203-204): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (359-360): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (365-366): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (460-461): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (557-558): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
Loading…
Reference in New Issue
Block a user