aeternity / aesophia

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

Name lambdas by their locations #486

Closed radrow closed 1 year ago

radrow commented 1 year ago

fixes #485

Previously names for lambdas were generated with use of a global counter. Since fcode functions are stored in maps, the order of processing local lambdas was unspecified. This resulted in lambdas getting names assigned non-deterministically during lifting.

This PR fixes that by naming lambdas according to their locations. Counters are still used to handle cases where locations are not available. However, those counters are now function-local. Inner AST has deterministic structure, thus lambdas will be numbered in DFS order.

PR is sponsored by ACF.

radrow commented 1 year ago

Just checked in HTTP that it does not reproduce on the provided example