mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
libsolc: Overhauls memory management.
This commit is contained in:
committed by
Alex Beregszaszi
parent
69b06a456c
commit
8682af2216
@@ -60,9 +60,10 @@ bool containsError(Json::Value const& _compilerResult, string const& _type, stri
|
||||
Json::Value compile(string const& _input, CStyleReadFileCallback _callback = nullptr)
|
||||
{
|
||||
string output(solidity_compile(_input.c_str(), _callback, nullptr));
|
||||
// This should be safe given the above copies the output.
|
||||
solidity_reset();
|
||||
Json::Value ret;
|
||||
BOOST_REQUIRE(jsonParseStrict(output, ret));
|
||||
solidity_free();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -74,14 +75,12 @@ BOOST_AUTO_TEST_CASE(read_version)
|
||||
{
|
||||
string output(solidity_version());
|
||||
BOOST_CHECK(output.find(VersionString) == 0);
|
||||
solidity_free();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(read_license)
|
||||
{
|
||||
string output(solidity_license());
|
||||
BOOST_CHECK(output.find("GNU GENERAL PUBLIC LICENSE") != string::npos);
|
||||
solidity_free();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(standard_compilation)
|
||||
|
||||
@@ -47,7 +47,7 @@ void FuzzerUtil::runCompiler(string const& _input, bool _quiet)
|
||||
cout << "Output JSON: " << outputString << endl;
|
||||
|
||||
// This should be safe given the above copies the output.
|
||||
solidity_free();
|
||||
solidity_reset();
|
||||
|
||||
Json::Value output;
|
||||
if (!jsonParseStrict(outputString, output))
|
||||
|
||||
Reference in New Issue
Block a user