diff options
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 05bc08f7..7a87875c 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -451,18 +451,20 @@ Json::Value const& CompilerStack::natspec(Contract const& _contract, Documentati { case DocumentationType::NatspecUser: doc = &_contract.userDocumentation; + // caches the result + if (!*doc) + doc->reset(new Json::Value(Natspec::userDocumentation(*_contract.contract))); break; case DocumentationType::NatspecDev: doc = &_contract.devDocumentation; + // caches the result + if (!*doc) + doc->reset(new Json::Value(Natspec::devDocumentation(*_contract.contract))); break; default: BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Illegal documentation type.")); } - // caches the result - if (!*doc) - doc->reset(new Json::Value(Natspec::documentation(*_contract.contract, _type))); - return *(*doc); } |