aeternity / aesophia

Stand alone compiler for the Sophia smart contract language
https://docs.aeternity.com/aesophia
ISC License
51 stars 19 forks source link

Variables to registers map does not handle shadowing #420

Closed ghallak closed 1 year ago

ghallak commented 1 year ago

When running the compiler with the debug_info flag, the expected variables_registers omits shadowed variables, and their registers will be unknown in the output as a result.

Code example:

contract C =
  entrypoint f(x) =
    let x = x + x
    x + x

The variables_registers map in the output from the compilation of the above example:

variables_registers => #{{"C","f","x"} => {var,0}}

In the above map, the register associated with the argument x (which should be {arg, 0}) does not show in the map because the arg x is shadowed by the variable x.

ghallak commented 1 year ago

This issue is not relevant anymore, as the variables_registers is not a part of the compiler output since release v7.2.0.