Skip to content

Commit

Permalink
IRGeneratorForStatements: Fix undefined order of functions when gener…
Browse files Browse the repository at this point in the history
…ating code for index expressions
  • Loading branch information
cameel committed Jul 13, 2023
1 parent 69c034b commit 16220db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Compiler Features:


Bugfixes:
* Code Generator: Fix not entirely deterministic order of functions in unoptimized Yul output. The choice of C++ compiler in some cases would result in different (but equivalent) bytecode (especially from native binaries vs emscripten binaries)
* Commandline Interface: Fix internal error when using ``--stop-after parsing`` and requesting some of the outputs that require full analysis or compilation.
* Commandline Interface: It is no longer possible to specify both ``--optimize-yul`` and ``--no-optimize-yul`` at the same time.
* SMTChecker: Fix encoding of side-effects inside ``if`` and ``ternary conditional``statements in the BMC engine.
Expand Down
3 changes: 2 additions & 1 deletion libsolidity/codegen/ir/IRGeneratorForStatements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2295,8 +2295,9 @@ void IRGeneratorForStatements::endVisit(IndexAccess const& _indexAccess)
}
case DataLocation::Memory:
{
string indexAccessFunction = m_utils.memoryArrayIndexAccessFunction(arrayType);
string const memAddress =
m_utils.memoryArrayIndexAccessFunction(arrayType) +
indexAccessFunction +
"(" +
IRVariable(_indexAccess.baseExpression()).part("mpos").name() +
", " +
Expand Down

0 comments on commit 16220db

Please sign in to comment.