mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix bug related to new code gen testing.
This commit is contained in:
parent
67a4d6f01d
commit
7c572dbfdf
@ -109,6 +109,10 @@ public:
|
||||
{
|
||||
m_compilerInput.optimiserSettings = _opt;
|
||||
}
|
||||
void viaIR(bool _viaIR)
|
||||
{
|
||||
m_compilerInput.viaIR = _viaIR;
|
||||
}
|
||||
void reset(bool _keepSettings)
|
||||
{
|
||||
m_compiler.reset(_keepSettings);
|
||||
@ -178,6 +182,10 @@ public:
|
||||
{
|
||||
m_compilationFramework.optSetting(_opt);
|
||||
}
|
||||
void viaIR(bool _viaIR)
|
||||
{
|
||||
m_compilationFramework.viaIR(_viaIR);
|
||||
}
|
||||
|
||||
/// @returns the result of the execution of the function whose
|
||||
/// keccak256 hash is @param _functionHash that is deployed at
|
||||
|
||||
@ -22,10 +22,12 @@
|
||||
|
||||
#include <test/TestCaseReader.h>
|
||||
|
||||
#include <evmone/evmone.h>
|
||||
#include <libyul/backends/evm/EVMCodeTransform.h>
|
||||
|
||||
#include <liblangutil/EVMVersion.h>
|
||||
|
||||
#include <evmone/evmone.h>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using namespace solidity::frontend::test;
|
||||
@ -112,18 +114,10 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
|
||||
|
||||
compilerSetting.runYulOptimiser = true;
|
||||
compilerSetting.optimizeStackAllocation = true;
|
||||
CompilerInput cInputOpt = {
|
||||
version,
|
||||
sourceCode,
|
||||
contractName,
|
||||
compilerSetting,
|
||||
{},
|
||||
false,
|
||||
true
|
||||
};
|
||||
hostContext.reset();
|
||||
evmoneUtil.reset(true);
|
||||
evmoneUtil.optSetting(compilerSetting);
|
||||
evmoneUtil.viaIR(true);
|
||||
auto compilerOutputOpt = evmoneUtil.compileContract();
|
||||
solAssert(compilerOutputOpt.has_value(), "Contract could not be optimised.");
|
||||
|
||||
@ -162,6 +156,10 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
catch (solidity::yul::StackTooDeepError const&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user