[LLVMbugs] [Bug 23094] New: WinEHPrepare needs to watch out for va_start in catch handlers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 31 17:51:47 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23094

            Bug ID: 23094
           Summary: WinEHPrepare needs to watch out for va_start in catch
                    handlers
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
void g();
int f(int a, ...) {
  try {
    g();
  } catch (int) {
    __builtin_va_list ap;
    __builtin_va_start(ap, a);
    int x = __builtin_va_arg(ap, int);
    __builtin_va_end(ap);
    return x;
  }
  return -1;
}

the outlined catch handler will contain:
  call void @llvm.va_start(i8* %ap1)

this will not end well for our catch handler seeing as how the arguments really
belong to the parent function.

-- 
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/20150401/67fb1749/attachment.html>


More information about the llvm-bugs mailing list