[LLVMbugs] [Bug 20048] New: Crash building CFG with -fms-compatibility -Wuninitialized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 15 22:33:32 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20048

            Bug ID: 20048
           Summary: Crash building CFG with -fms-compatibility
                    -Wuninitialized
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alp at nuanti.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Test case crashes with clang r211005:

// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11
-Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions
-Wuninitialized

namespace ms_protected_scope {
  struct C { C(); };

  int jump_over_variable_init(bool b) {
    if (b)
      goto foo; // expected-warning {{goto into protected scope}}
    C c; // expected-note {{jump bypasses variable initialization}}
  foo:
    return 1;
  }

  struct Y {
    ~Y();
  };

  void jump_over_var_with_dtor() {
    goto end; // expected-warning{{goto into protected scope}}
    Y y; // expected-note {{jump bypasses variable with a non-trivial
destructor}}
   end:
      ;
  }

}



Trace:

Assertion failed: (F != const_iterator() && "L iterator is not reachable from F
iterator."), function distance, file
/Users/alp/Projects/llvm-work/upstream/clang/lib/Analysis/CFG.cpp, line 198.
0  libLLVMSupport.dylib       0x000000010be4e6bf
llvm::sys::PrintStackTrace(__sFILE*) + 40
1  libLLVMSupport.dylib       0x000000010be4eaaa SignalHandler(int) + 248
2  libsystem_platform.dylib   0x00007fff939f05aa _sigtramp + 26
3  libsystem_platform.dylib   000000000000000000 _sigtramp + 1818294896
4  libLLVMSupport.dylib       0x000000010be4e911 abort + 22
5  libLLVMSupport.dylib       0x000000010be4e8fb abort + 0
6  libclangAnalysis.dylib     0x000000010d59ec7e (anonymous
namespace)::LocalScope::const_iterator::distance((anonymous
namespace)::LocalScope::const_iterator) + 82
7  libclangAnalysis.dylib     0x000000010d5a364d (anonymous
namespace)::CFGBuilder::addAutomaticObjDtors((anonymous
namespace)::LocalScope::const_iterator, (anonymous
namespace)::LocalScope::const_iterator, clang::Stmt*) + 145
8  libclangAnalysis.dylib     0x000000010d5a06b8 (anonymous
namespace)::CFGBuilder::Visit(clang::Stmt*, (anonymous
namespace)::AddStmtChoice) + 4406
9  libclangAnalysis.dylib     0x000000010d5a324b (anonymous
namespace)::CFGBuilder::VisitCompoundStmt(clang::CompoundStmt*) + 69
10 libclangAnalysis.dylib     0x000000010d5a0493 (anonymous
namespace)::CFGBuilder::Visit(clang::Stmt*, (anonymous
namespace)::AddStmtChoice) + 3857
11 libclangAnalysis.dylib     0x000000010d59b066
clang::CFG::buildCFG(clang::Decl const*, clang::Stmt*, clang::ASTContext*,
clang::CFG::BuildOptions const&) + 1502
12 libclangAnalysis.dylib     0x000000010d594d6f
clang::AnalysisDeclContext::getCFG() + 111
13 libclangSema.dylib         0x000000010cf05f5d
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
4067
14 libclangSema.dylib         0x000000010cf39583
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 97
15 libclangSema.dylib         0x000000010cfbcd19
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 2285
16 libclangParse.dylib        0x000000010cd725db
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 287
17 libclangParse.dylib        0x000000010cd802e4
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2104

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140616/f81788ab/attachment.html>


More information about the llvm-bugs mailing list