Skip to content

Commit 093919e

Browse files
committed
Prevent crash when translating yul->ewasm with @use-src annotations
1 parent fc41083 commit 093919e

File tree

6 files changed

+5204
-1
lines changed

6 files changed

+5204
-1
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### 0.8.11 (unreleased)
2+
3+
Bugfixes:
4+
* Code Generator: Fix a crash when using ``@use-src`` and compiling from Yul to ewasm
5+
6+
17
### 0.8.10 (2021-11-09)
28

39
Language Features:

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)