aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/analysis/ControlFlowAnalyzer.cpp7
-rw-r--r--test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_internal.sol4
-rw-r--r--test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_library.sol4
4 files changed, 14 insertions, 2 deletions
diff --git a/Changelog.md b/Changelog.md
index ff95a89a..2e5a3044 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -111,6 +111,7 @@ Bugfixes:
* Code Generator: Properly handle negative number literals in ABIEncoderV2.
* Code Generator: Do not crash on using a length of zero for multidimensional fixed-size arrays.
* Commandline Interface: Correctly handle paths with backslashes on windows.
+ * Control Flow Analyzer: Ignore unimplemented functions when detecting uninitialized storage pointer returns.
* Fix NatSpec json output for `@notice` and `@dev` tags on contract definitions.
* Optimizer: Correctly estimate gas costs of constants for special cases.
* Optimizer: Fix simplification rule initialization bug that appeared on some emscripten platforms.
diff --git a/libsolidity/analysis/ControlFlowAnalyzer.cpp b/libsolidity/analysis/ControlFlowAnalyzer.cpp
index ab6569be..8a608552 100644
--- a/libsolidity/analysis/ControlFlowAnalyzer.cpp
+++ b/libsolidity/analysis/ControlFlowAnalyzer.cpp
@@ -28,8 +28,11 @@ bool ControlFlowAnalyzer::analyze(ASTNode const& _astRoot)
bool ControlFlowAnalyzer::visit(FunctionDefinition const& _function)
{
- auto const& functionFlow = m_cfg.functionFlow(_function);
- checkUnassignedStorageReturnValues(_function, functionFlow.entry, functionFlow.exit);
+ if (_function.isImplemented())
+ {
+ auto const& functionFlow = m_cfg.functionFlow(_function);
+ checkUnassignedStorageReturnValues(_function, functionFlow.entry, functionFlow.exit);
+ }
return false;
}
diff --git a/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_internal.sol b/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_internal.sol
new file mode 100644
index 00000000..8bce0dd2
--- /dev/null
+++ b/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_internal.sol
@@ -0,0 +1,4 @@
+contract C {
+ function f() internal returns(uint[] storage);
+ function g() internal returns(uint[] storage s);
+}
diff --git a/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_library.sol b/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_library.sol
new file mode 100644
index 00000000..818b6a20
--- /dev/null
+++ b/test/libsolidity/syntaxTests/controlFlow/storageReturn/unimplemented_library.sol
@@ -0,0 +1,4 @@
+library L {
+ function f() public returns(uint[] storage);
+ function g() public returns(uint[] storage s);
+}