diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2025-04-01 16:10:38 +0200 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2025-04-07 08:18:19 +0000 |
commit | 8a65b913d4c4f00c2b8aa6827c733786e4a0266e (patch) | |
tree | 679321fe058e44b748157a90bf8de84dd5c11192 /gcc | |
parent | 75b7b7c210c62405a29068826d5ebb67ac6d6d68 (diff) | |
download | gcc-8a65b913d4c4f00c2b8aa6827c733786e4a0266e.zip gcc-8a65b913d4c4f00c2b8aa6827c733786e4a0266e.tar.gz gcc-8a65b913d4c4f00c2b8aa6827c733786e4a0266e.tar.bz2 |
Update ast visitor with proper check for looplabel
The visitor was visiting loop label even when they did not exist.
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Add
check for loop label before visiting it.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast-visitor.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-visitor.cc b/gcc/rust/ast/rust-ast-visitor.cc index 7791489..3a06d2d 100644 --- a/gcc/rust/ast/rust-ast-visitor.cc +++ b/gcc/rust/ast/rust-ast-visitor.cc @@ -559,7 +559,8 @@ void DefaultASTVisitor::visit (AST::LoopExpr &expr) { visit_outer_attrs (expr); - visit (expr.get_loop_label ()); + if (expr.has_loop_label ()) + visit (expr.get_loop_label ()); visit (expr.get_loop_block ()); } |