solidity icon indicating copy to clipboard operation
solidity copied to clipboard

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

Open Subway2023 opened this issue 1 year ago • 1 comments

Environment

  • Compiler version: 0.8.25
  • Target EVM version (as per compiler settings): None
  • Framework/IDE (e.g. Truffle or Remix): None
  • EVM execution environment / backend / blockchain client: Command
  • Operating system: Linux

Steps to Reproduce

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

Segmentation fault

Subway2023 avatar May 03 '24 22:05 Subway2023

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()) = ();
    }
}

r0qs avatar May 08 '24 14:05 r0qs