diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2025-03-31 17:01:18 +0200 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2025-04-07 08:18:19 +0000 |
commit | 676e3eacc36a233dec52023faa9f3c78007bbabe (patch) | |
tree | ddbc0508006cbd006b1f79105828621efd0e1b34 /gcc/rust/ast | |
parent | be0d14806500f75266d2ad507cf7018de6a24766 (diff) | |
download | gcc-676e3eacc36a233dec52023faa9f3c78007bbabe.zip gcc-676e3eacc36a233dec52023faa9f3c78007bbabe.tar.gz gcc-676e3eacc36a233dec52023faa9f3c78007bbabe.tar.bz2 |
Add check for label
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit loop label
only if it exists.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove passing test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/ast')
-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 2949f1c..b5da001 100644 --- a/gcc/rust/ast/rust-ast-visitor.cc +++ b/gcc/rust/ast/rust-ast-visitor.cc @@ -568,7 +568,8 @@ DefaultASTVisitor::visit (AST::WhileLoopExpr &expr) { visit_outer_attrs (expr); visit (expr.get_predicate_expr ()); - visit (expr.get_loop_label ()); + if (expr.has_loop_label ()) + visit (expr.get_loop_label ()); visit (expr.get_loop_block ()); } |