[llvm-bugs] [Bug 40436] New: Infinite recursion in StackProtector::HasAddressTaken due to self-referencing code in dead basic block

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 24 04:37:36 PST 2019


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

            Bug ID: 40436
           Summary: Infinite recursion in StackProtector::HasAddressTaken
                    due to self-referencing code in dead basic block
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21376
  --> https://bugs.llvm.org/attachment.cgi?id=21376&action=edit
reproducer

Reproduce with

llc -mtriple=x86_64-unknown-unknown -start-before=stack-protector
-stop-after=stack-protector stack-protector-unreachable-code.ll

The input looks like this:

define void @f() sspreq {
entry:
  %ai = alloca i8, align 1
  ret void

dead:
  %user = select i1 undef, i8* %ai, i8* %user
  unreachable
}

The problem occurs when StackProtector::HasAddressTaken is called on

   %ai = alloca i8, align 1

and then

  %user = select i1 undef, i8* %ai, i8* %user

since HasAddressTaken will be called on

  %user = select i1 undef, i8* %ai, i8* %user

over and over again until the stack is blown.

Since the instruction is in a unreachable basic block the input is ok even if
it normally isn't.

-- 
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/20190124/b3e45329/attachment-0001.html>


More information about the llvm-bugs mailing list