mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Prevent crash when translating yul->ewasm with @use-src annotations
This commit is contained in:
@@ -137,7 +137,11 @@ void EVMToEwasmTranslator::parsePolyfill()
|
||||
string(solidity::yul::wasm::polyfill::Logical) +
|
||||
string(solidity::yul::wasm::polyfill::Memory) +
|
||||
"}", "");
|
||||
m_polyfill = Parser(errorReporter, WasmDialect::instance()).parse(charStream);
|
||||
|
||||
// Passing an empty SourceLocation() here is a workaround to prevent a crash
|
||||
// when compiling from yul->ewasm. We're stripping nativeLocation and
|
||||
// originLocation from the AST (but we only really need to strip nativeLocation)
|
||||
m_polyfill = Parser(errorReporter, WasmDialect::instance(), langutil::SourceLocation()).parse(charStream);
|
||||
if (!errors.empty())
|
||||
{
|
||||
string message;
|
||||
|
||||
Reference in New Issue
Block a user