【问题标题】:Solidity Internal exception in StandardCompiler标准编译器中的 Solidity 内部异常
【发布时间】:2020-01-10 15:09:46
【问题描述】:

这是源代码

pragma solidity ^0.5.1;

contract myContract{
    string value;

    constructor() public {
        value = "myValue";
    }

    function get() public view returns(string memory){
        return value;
    }

    function set(string memory _value) public{
        value = _value;
    }
}

在 Remix IDE 上选择的编译器是 0.5.1+commit.c8a2cb62 选择的环境是Javascript VM

当我编译命令时,我得到了这个错误

Internal exception in StandardCompiler::compileInternal: /root/project/libevmasm/ExpressionClasses.cpp(187): Throw in function ExpressionClasses::Id dev::eth::ExpressionClasses::tryToSimplify(const dev::eth::ExpressionClasses::Expression &)
Dynamic exception type: boost::exception_detail::clone_impl<dev::eth::OptimizerException>
std::exception::what: Rule list not properly initialized.
[dev::tag_comment*] = Rule list not properly initial

但是,如果我将编译器选择为0.5.11,则不会针对相同的源代码弹出此错误

其他用户说他们在 pre0.5.3 编译器上遇到此错误。

【问题讨论】:

  • 我可以使用 Remix 用 0.5.1 编译并且没有报错。

标签: ethereum solidity remix


【解决方案1】:

这是某个版本的编译器中的一个错误——如果 javascript 运行时环境没有提供足够的堆栈空间或内存,它就无法正常工作。它应该适用于最新的编译器。 查看此thread 了解更多信息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-21
    • 2023-02-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多