Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing library template parameter in IR codegen on EOF #15606

Closed
wants to merge 2 commits into from

Conversation

cameel
Copy link
Member

@cameel cameel commented Dec 2, 2024

Fixes a small bug that went unnoticed in #15512 because we don't run most tests on EOF yet: the IR codegen template is missing a parameter.

Running tests for immutables without the fix results in:

semanticTests/immutable/stub.sol: Unhandled exception during test: /solidity/libsolutil/Whiskers.cpp(213): Throw in function solidity::util::Whiskers::replace(const std::string&, const StringMap&, const std::map<std::__cxx11::basic_string<char>, bool>&, const std::map<std::__cxx11::basic_string<char>, std::vector<std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >&)::<lambda(std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >)>
Dynamic exception type: boost::wrapexcept<solidity::util::WhiskersError>
std::exception::what: WhiskersError
[solidity::util::tag_comment*] = Condition parameter library not set.

I'm also including a commit that makes the test mentioned in #15550 (review) actually run on EOF too.

@cameel cameel added the EOF label Dec 2, 2024
@cameel cameel requested a review from clonker December 2, 2024 17:55
@cameel cameel self-assigned this Dec 2, 2024
@cameel
Copy link
Member Author

cameel commented Dec 2, 2024

Oh, looks like that wasn't the only bug here:

/solidity/test/soltest.cpp(120): error: in "semanticTests/immutable/stub": Exception during extracted test: /solidity/libsolidity/codegen/ir/IRGenerationContext.cpp(103): Throw in function size_t solidity::frontend::IRGenerationContext::immutableMemoryOffset(const solidity::frontend::VariableDeclaration&) const
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Unknown immutable variable: x
[solidity::util::tag_comment*] = Unknown immutable variable: x

@cameel cameel mentioned this pull request Dec 11, 2024
@clonker
Copy link
Member

clonker commented Dec 11, 2024

I guess I'll wait with the review until CI is green? @cameel

@cameel
Copy link
Member Author

cameel commented Dec 11, 2024

It won't get green ;) @rodiazet took it over and part of this is already merged. I kept it open only to make sure that all the other bits are not forgotten about. It will get closed by #15628.

@clonker
Copy link
Member

clonker commented Dec 11, 2024

Haha ok, good to know!

@clonker clonker deleted the eof-fix-missing-codegen-template-arg branch December 12, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants