aptos-core
aptos-core copied to clipboard
[Bug][move-compiler-v2] add a check for maximum expression depth
🐛 Bug
We should avoid an OOS failure of the compiler and instead add a check for expression nesting depth when building the model (or maybe even earlier, in the parser) to some reasonable value and issue a sensible error message rather than fail in the expression translator.
We can probably have the ExpressionTranslator object track depth with a mutable field and just increment and decrement it on some key recursive function entry/return pairs.