[LLVMbugs] [Bug 9928] New: objective C rewriter doesn't like token-pasting

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 16 04:52:49 PDT 2011


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

           Summary: objective C rewriter doesn't like token-pasting
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: madcoder at debian.org
                CC: llvmbugs at cs.uiuc.edu


If you have code with blocks inside macros with token pasting in it, the
rewriter crashes. If you remove the token pasting it works just fine.

In the example below, the 'void (^blk)(void)' is to trigger a rewrite that
results in a crash.

$ cat a.m
#define paste(n) \
    static void _##n(void (^blk)(void)) { }

paste(foo);

$ clang -cc1 -fblocks -rewrite-objc a.m -o a.cc
0  clang           0x00000000019d32bf
1  clang           0x00000000019d3dfa
2  libpthread.so.0 0x00007f79c7ac4020
3  clang           0x0000000000d6de80
4  clang           0x0000000000d6e5a0
5  clang           0x0000000000d7fa5f
6  clang           0x0000000000d802e8
7  clang           0x0000000000d8149f
8  clang           0x00000000008fa6d4 clang::ParseAST(clang::Sema&, bool) + 228
9  clang           0x00000000006a6ba3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
10 clang           0x000000000067f66a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1290
11 clang           0x000000000067475d cc1_main(char const**, char const**, char
const*, void*) + 701
12 clang           0x000000000067e3b2 main + 6818
13 libc.so.6       0x00007f79c6daaead __libc_start_main + 253
14 clang           0x00000000006742b9
Stack dump:
0.    Program arguments: clang -cc1 -fblocks -rewrite-objc a.m -o a.cc 
1.    a.m:4:11: current parser token ';'
[1]    15995 segmentation fault  clang -cc1 -fblocks -rewrite-objc a.m -o a.cc

-- 
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