From d977e6b0eb4c9b57b0aad6e9e0be39cc67b3a8c7 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 3 Dec 2011 03:49:47 +0000 Subject: [PATCH] [libclang] Fix infinite loop when doing visitation of an OpaqueValueExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145751 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Index/get-cursor.cpp | 4 ++++ tools/libclang/CIndex.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Index/get-cursor.cpp b/test/Index/get-cursor.cpp index db27c241fd..e1e6835bec 100644 --- a/test/Index/get-cursor.cpp +++ b/test/Index/get-cursor.cpp @@ -89,3 +89,7 @@ void test() { // RUN: c-index-test -cursor-at=%s:38:12 -cursor-at=%s:39:5 %s | FileCheck -check-prefix=CHECK-CXXCATCH %s // CHECK-CXXCATCH: TypeRef=struct X:3:8 // CHECK-CXXCATCH-NEXT: TypeRef=struct X:3:8 + +// RUN: c-index-test -test-load-source-usrs local %s | FileCheck -check-prefix=CHECK-USR %s +// CHECK-USR: get-cursor.cpp c:get-cursor.cpp@472@F@test#@e Extent=[38:12 - 38:15] +// CHECK-USR: get-cursor.cpp c:get-cursor.cpp@483@F@test#@x Extent=[39:5 - 39:8] diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index a189042f56..d2b5ba7ce5 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -2084,7 +2084,6 @@ void EnqueueVisitor::VisitOpaqueValueExpr(OpaqueValueExpr *E) { // visit that. This is useful for (e.g.) pseudo-object expressions. if (Expr *SourceExpr = E->getSourceExpr()) return Visit(SourceExpr); - AddStmt(E); } void EnqueueVisitor::VisitPseudoObjectExpr(PseudoObjectExpr *E) { // Treat the expression like its syntactic form. -- 2.40.0