HTTPS clone URL
Subversion checkout URL
Please sign in to comment.
Strange interactions between a break statement and ensure blocks The current compiler does an "inspection" pass over the AST to see whether certain optimizations are possible. For the most part, this inspection just sets a few bits on the inspector that are used to alter compilation, but there are a few cases like non- local flow control (e.g. a while loop with a break inside a closure or rescue/ensure) where we actually alter the AST to indicate there's something special. The presence of certain AST nodes disables all optimizations, largely because those nodes are difficult or impossible to support properly without JVM gymnastics that make our usual set of optimizations impossible. ensure is one such case, and the inspector disables all optimizations when an ensure is encountered. However, it should still run the inspection of all child nodes, since as mentioned above there are state changes on the AST itself that still need to happen in order for those nodes to compile properly. I audited all places in ASTInspector where we do a hard disable() call and made sure those locations still proceed to inspect the downstream AST nodes, which fixes this bug and should prevent other cases from popping up.
- Loading branch information...
Showing with 30 additions and 1 deletion.