mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
libsolc: change return type of compile to non-const
This commit is contained in:
parent
2ccf3ea4ab
commit
6e6bc9904f
@ -125,7 +125,7 @@ extern char const* solidity_version() noexcept
|
|||||||
return VersionString.c_str();
|
return VersionString.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern char const* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback, void* _readContext) noexcept
|
extern char* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback, void* _readContext) noexcept
|
||||||
{
|
{
|
||||||
return solidityAllocations.emplace_back(compile(_input, _readCallback, _readContext)).data();
|
return solidityAllocations.emplace_back(compile(_input, _readCallback, _readContext)).data();
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ void solidity_free(char* _data) SOLC_NOEXCEPT;
|
|||||||
/// @param _readContext An optional context pointer passed to _readCallback. Can be NULL.
|
/// @param _readContext An optional context pointer passed to _readCallback. Can be NULL.
|
||||||
///
|
///
|
||||||
/// @returns A pointer to the result. The pointer returned must be freed by the caller using solidity_free() or solidity_reset().
|
/// @returns A pointer to the result. The pointer returned must be freed by the caller using solidity_free() or solidity_reset().
|
||||||
char const* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback, void* _readContext) SOLC_NOEXCEPT;
|
char* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback, void* _readContext) SOLC_NOEXCEPT;
|
||||||
|
|
||||||
/// Frees up any allocated memory.
|
/// Frees up any allocated memory.
|
||||||
///
|
///
|
||||||
|
@ -59,7 +59,7 @@ bool containsError(Json::Value const& _compilerResult, string const& _type, stri
|
|||||||
|
|
||||||
Json::Value compile(string const& _input, CStyleReadFileCallback _callback = nullptr)
|
Json::Value compile(string const& _input, CStyleReadFileCallback _callback = nullptr)
|
||||||
{
|
{
|
||||||
const char* output_ptr = solidity_compile(_input.c_str(), _callback, nullptr);
|
char* output_ptr = solidity_compile(_input.c_str(), _callback, nullptr);
|
||||||
string output(output_ptr);
|
string output(output_ptr);
|
||||||
solidity_free(output_ptr);
|
solidity_free(output_ptr);
|
||||||
solidity_reset();
|
solidity_reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user