[llvm-bugs] [Bug 25859] New: MSVC: Segfault witch cleanupret to catchswitch

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 16 17:44:32 PST 2015


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

            Bug ID: 25859
           Summary: MSVC: Segfault witch cleanupret to catchswitch
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: alex at crichton.co
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following IR is reduced greatly from a Rust program, and I'm not 100% sure
if it's legal. Currently when compiled, however, it will segfault. When the
call to GetProcessHeap is omitted it will not segfault oddly enough.



target triple = "i686-pc-windows-msvc"

declare i32 @_except_handler3(...)
declare x86_stdcallcc void @RaiseException(i32, i32, i32, i64*)
declare x86_stdcallcc i8* @GetProcessHeap()

define i32 @main() personality i32 (...)* @_except_handler3 {
top:
  invoke x86_stdcallcc void @RaiseException(i32 5395284, i32 0, i32 0, i64*
null)
          to label %impossible unwind label %cleanup

impossible:
  unreachable

cleanup:
  %cleanuppad = cleanuppad within none []
  %t = tail call x86_stdcallcc i8* @GetProcessHeap()
  cleanupret from %cleanuppad unwind label %catchswitch

catchswitch:
  %cs = catchswitch within none [label %catchpad] unwind to caller

catchpad:
  %cp = catchpad within %cs [i8* bitcast (i32 ()* @filter to i8*)]
  catchret from %cp to label %exit

exit:
  ret i32 101
}

define internal i32 @filter() {
entry-block:
  ret i32 1
}

-- 
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/20151217/b1abacba/attachment-0001.html>


More information about the llvm-bugs mailing list