ethereum / solidity

Solidity, the Smart Contract Programming Language
https://soliditylang.org
GNU General Public License v3.0
23.13k stars 5.74k forks source link

Segmentation fault when assigning to a parenthesized non-tuple expression of a tuple type #15075

Closed Subway2023 closed 4 months ago

Subway2023 commented 5 months ago

Environment

Steps to Reproduce

contract A {
    function f ( ) internal virtual {
        ( ( f() ) -= f() ) [ f() ] ;
    }
}

Segmentation fault

r0qs commented 4 months ago

Hi @Subway2023 thanks for opening the issue. We are indeed incorrectly detecting assignments to empty tuple expressions. I opened a PR to fix it ;)

A simpler reproduction of the bug would be:

contract C {
    function f() {
        (f()) = ();
    }
}