Hi all, apologies in advance if this is not the right place to ask this. If so, please let me know the more appropriate channel to ask these questions.
I was reading through Solidity IR-based Codegen Changes — Solidity 0.8.23 documentation but don’t really understand the explanations for:
-
Evaluation order of expression
For the old code generator, the evaluation order of expressions is unspecified
but how does the compiler decide whether to go from left to right or right to left?For the new code generator, we try to evaluate in source order (left to right), but do not guarantee it
. What is an example of when this is not guaranteed and why is this not guaranteed? As a protocol developer, how can I ensure that my functions are always executed in the right order? Is it possible for different compiler versions to execute functions in the opposite order?
-
Internal function pointers
In the new code generator, function pointers use internal IDs that are allocated in sequence
. What exactly is a function pointer and how can I see these internal IDs and the internal dispatch function in action? Is this the same dispatch function as the traditional dispatch function where the current selector is matched against all selectors in the contract?
Any help is appreciated.