aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Bug][move-compiler-v2] move-model AST represents short-cut `||` and `&&` as simple Calls, check for potential errors

Open brmataptos opened this issue 8 months ago • 1 comments

🐛 Bug

I (Brian) implemented various optimizations on the movel-model AST without realizing that short-cutting || and && haven't been lowered to more explicit control flow, but remain as Call expressions. This means that the potential control flow is more complex and assumptions about execution order may have been broken.

We need to re-examine all AST passes to make sure there are no erronsous implications from this.

In many cases, this won't matter, as analyses are flow-insensitive. And in some cases this may be good. For example, false && expr can be constant-folded to eliminate expr, even if expr has side-effects or does other interesting things.

brmataptos avatar Jun 13 '24 17:06 brmataptos