[LLVMbugs] [Bug 1740] New: segfault when using va_arg on x86-68

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Oct 23 20:36:23 PDT 2007


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

           Summary: segfault when using va_arg on x86-68
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: tomas.l.olsen at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Using the LLVM 2.1 release, the following test case segfaults when run;

a.ll:

define i32 @test(i32 %X, ...) {
  %ap = alloca i8*, i32 1024
  %ap2 = bitcast i8** %ap to i8*
  call void @llvm.va_start(i8* %ap2)
  %tmp = va_arg i8** %ap, i32
  call void @llvm.va_end(i8* %ap2)
  ret i32 %tmp
}

declare void @llvm.va_start(i8*)
declare void @llvm.va_end(i8*)

define i32 @main(i32, i8**, i8**) {
  %ret = call i32(i32, ...)* @test(i32 0, i32 0)
  ret i32 %ret
}

result:

$ llvm-as -f a.ll && llc -f a.bc && gcc a.s && ./a.out
Segmentation fault
$


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