Fix error message about accessing storage pointers.

This commit is contained in:
chriseth 2019-09-19 13:20:30 +02:00
parent c4208a6ab8
commit ca21659749
18 changed files with 33 additions and 33 deletions

View File

@ -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."
);
}
}

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.