Skip to content

Commit 73822cf

Browse files
committed
Prevent crash when translating yul->ewasm with @use-src annotations
1 parent 401dd43 commit 73822cf

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Compiler Features:
1515

1616

1717
Bugfixes:
18+
* Code Generator: Fix a crash when using ``@use-src`` and compiling from Yul to ewasm
1819
* Code Generator: Fix constructor source mappings for immutables.
1920
* Commandline Interface: Fix extra newline character being appended to sources passed through standard input, affecting their hashes.
2021
* Commandline Interface: Report output selection options unsupported by the selected input mode instead of ignoring them.

libyul/backends/wasm/EVMToEwasmTranslator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void EVMToEwasmTranslator::parsePolyfill()
137137
string(solidity::yul::wasm::polyfill::Logical) +
138138
string(solidity::yul::wasm::polyfill::Memory) +
139139
"}", "");
140-
m_polyfill = Parser(errorReporter, WasmDialect::instance()).parse(charStream);
140+
m_polyfill = Parser(errorReporter, WasmDialect::instance(), langutil::SourceLocation()).parse(charStream);
141141
if (!errors.empty())
142142
{
143143
string message;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--strict-assembly --yul-dialect evm --machine ewasm
2+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Warning: Yul is still experimental. Please use the output with care.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/// @use-src 0:"test.sol"
2+
object "C" {
3+
code {}
4+
}

0 commit comments

Comments
 (0)