[LLVMbugs] [Bug 17202] New: "function-local metadata used in wrong function" for a small ObjC program with a block

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 12 02:05:00 PDT 2013


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

            Bug ID: 17202
           Summary: "function-local metadata used in wrong function" for a
                    small ObjC program with a block
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: glider at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat MPS.ii
@interface NSDictionary @end
@interface NSDictionary (NSExtendedDictionary)  - (NSDictionary *)allKeys; @end
@interface NSDictionary (NSDictionaryCreation)  + (id)dictionary; @end 
@protocol Cache
  - (void)completionHandler:(void (^)())handler;
@end
@interface Cache<Cache>  @end
Cache *cache;

void save() { 
  NSDictionary *data = [NSDictionary dictionary];
  [cache
   completionHandler:^(){
      if (0) {  NSDictionary *storedKeys = [data allKeys]; }
    }
  ]; 
}

-----------------------cut---------------------------

$ clang -ObjC -g -c MPS.ii -o MPS.o
function-local metadata used in wrong function
metadata !{<{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %1* }>**
%block.addr}
  %block.addr = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %1*
}>*, align 8
Broken module found, compilation aborted!
0  clang-3.4         0x00000001057989a8 llvm::sys::PrintStackTrace(__sFILE*) +
40
1  clang-3.4         0x0000000105798ef4 SignalHandler(int) + 644
2  libsystem_c.dylib 0x00007fff8cbe894a _sigtramp + 26
3  libsystem_c.dylib 000000000000000000 _sigtramp + 1933670096
4  clang-3.4         0x0000000105798c56 abort + 22
5  clang-3.4         0x00000001056c5beb (anonymous
namespace)::Verifier::abortIfBroken() + 523
6  clang-3.4         0x00000001056c5849 (anonymous
namespace)::Verifier::runOnFunction(llvm::Function&) + 1945
...
0.      Program arguments: <cut>/bin/clang-3.4 -cc1 -triple
x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -main-file-name
MPS.ii -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -gdwarf-2 -coverage-file <cut>/MPS.o
-resource-dir <cut>/../lib/clang/3.4 -fdebug-compilation-dir <cut>
-ferror-limit 19 -fmessage-length 164 -stack-protector 1 -mstackrealign
-fblocks -fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fobjc-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o MPS.o -x objective-c MPS.ii 
1.      <eof> parser at end of file
2.      Per-function optimization
3.      Running pass 'Module Verifier' on function '@__save_block_invoke'
clang-3.4: error: unable to execute command: Illegal instruction: 4

-- 
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/20130912/d69692eb/attachment.html>


More information about the llvm-bugs mailing list