diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-01-08 16:21:59 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-01-09 14:47:04 +0000 |
commit | 6d7a53b684b5765acda82f39f71bc7798bf0ee94 (patch) | |
tree | 96674528f5dc88f78bd39f551624f3ff7105ccb1 /gcc/rust/hir/rust-ast-lower-block.h | |
parent | 705b8b73aa694a8cc79c4459beca192145f97542 (diff) | |
download | gcc-6d7a53b684b5765acda82f39f71bc7798bf0ee94.zip gcc-6d7a53b684b5765acda82f39f71bc7798bf0ee94.tar.gz gcc-6d7a53b684b5765acda82f39f71bc7798bf0ee94.tar.bz2 |
Fix crash when compiling BlockExpr's
This ensures the compiler respects scoping and shadowing rules of
blocks added within an enclosing scope.
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-block.h')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-block.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-block.h b/gcc/rust/hir/rust-ast-lower-block.h index 1ef581e..f81a242 100644 --- a/gcc/rust/hir/rust-ast-lower-block.h +++ b/gcc/rust/hir/rust-ast-lower-block.h @@ -129,6 +129,11 @@ public: translated = ASTLoweringIfBlock::translate (&expr, &terminated); } + void visit (AST::BlockExpr &expr) + { + translated = ASTLoweringBlock::translate (&expr, &terminated); + } + private: ASTLoweringExprWithBlock () : ASTLoweringBase (), translated (nullptr), terminated (false) |