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

An internal error occurs if the receive function calls an internal function #17

Open
charles-liu opened this issue Apr 1, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@charles-liu
Copy link
Contributor

Compile the following contract:

// SPDX-License-Identifier: GPL-3.0
pragma soliditypp ^0.8.0;

contract TestReceive {
    receive() external payable {
        uint i = test();
    }

    function test() pure internal returns(uint) {
        return 3;
    }
}

You will get an internal error:

Internal compiler error during compilation:
/solidity/libsolidity/interface/CompilerStack.cpp(1226): Throw in function void solidity::frontend::CompilerStack::compileContract(const solidity::frontend::ContractDefinition &, map<const solidity::frontend::ContractDefinition *, shared_ptr<const solidity::frontend::Compiler>> &)
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Assembly exception for bytecode: Reference to tag without position: 7
[solidity::util::tag_comment*] = Assembly exception for bytecode: Reference to tag without position: 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant