[PATCH] D12805: [mips] Save a copy of MipsABIInfo in the MipsTargetStreamer to escape a dangling pointer

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 12 00:59:20 PDT 2015


atanasyan added a comment.

In http://reviews.llvm.org/D12805#244314, @dsanders wrote:

> I think I can probably guess (direct object emission?) but can you tell me what situation causes MipsELFTargetStreamer to out live MipsAsmParser?


The following test case reproduces the problem. I am going to commit it to the clang repository after this fix.

  // REQUIRES: mips-registered-target                                                                                                                                                                                
  // RUN: %clang_cc1 -triple mips-linux-gnu -emit-obj -o - %s | \                                                                                                                                                    
  // RUN:   llvm-readobj -h - | FileCheck %s                                                                                                                                                                           
                                                                                                                                                                                                                     
  // CHECK: EF_MIPS_ABI_O32                                                                                                                                                                                          
                                                                                                                                                                                                                     
  __asm__(                                                                                                                                                                                                           
  "bar:\n"                                                                                                                                                                                                           
  "  nop\n"                                                                                                                                                                                                          
  );                                                                                                                                                                                                                 
                                                                                                                                                                                                                     
  void foo() {}


Repository:
  rL LLVM

http://reviews.llvm.org/D12805





More information about the llvm-commits mailing list