[LLVMbugs] [Bug 14840] New: assertion (and crash) with message "cleanups within block not correctly bound" while compiling Obj-C with block

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 7 14:56:54 PST 2013


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

             Bug #: 14840
           Summary: assertion (and crash) with message "cleanups within
                    block not correctly bound" while compiling Obj-C with
                    block
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9830
  --> http://llvm.org/bugs/attachment.cgi?id=9830
Reduced test case

clang trunk (r171801) assert and crash while trying to compile "invalid" obj-c
code involving block and ARC:

---------
@interface Foo

@end

void test() {
  Foo *_connection = (id)0;
  [_connection reply:^(const int *reply, int length) {
    [_connection reply:^(const int *reply, int length) {
      [_connection reply:^(const int *reply, int length) {

      }];
    }];
  }];

}
-----------
$ clang -fobjc-arc -fsyntax-only testcase.m
Assertion failed: (!ExprNeedsCleanups && "cleanups within block not correctly
bound!"), function ActOnBlockStmtExpr, file
/llvm/tools/clang/lib/Sema/SemaExpr.cpp, line 9522.
…
6  clang             0x000000010fd60ff6
clang::Sema::ActOnBlockStmtExpr(clang::SourceLocation, clang::Stmt*,
clang::Scope*) + 2070
7  clang             0x000000010fbb84b3
clang::Parser::ParseBlockLiteralExpression() + 1587
8  clang             0x000000010fbb1289
clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState) + 1353
9  clang             0x000000010fbae977
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 135
…
1.    testcase.m:14:4: current parser token ']'
2.    testcase.m:6:13: parsing function body 'test'
3.    testcase.m:6:13: in compound statement ('{}')
4.    testcase.m:8:22: block literal parsing

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list