[PATCH] D86673: Conservatively merge &&Variable for catch(Variable)

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 20:24:31 PDT 2020


xiangzhangllvm created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a reviewer: gkistanova.
Herald added a project: LLVM.
xiangzhangllvm requested review of this revision.

Conservatively merge &&Variable for catch(Variable), EH libs may write the catch value and return the Point (Type**) (&&Variable) back.
This Point may be dangerously over written due to some work of objects' destructor in try block. (The destructor may work after EH written)

In fact, for Variable in catch, there is usually a very long life range guarded with TIME_START and TIME_END (usually almost through the whole program), 
but there is a potion "-stackcoloring-lifetime-start-on-first-use" which will cut it in stack.

I find this bug in a big win32 project, which hard to reproduce, so I add a Machine IR test to just run stack-coloring pass.

try{
...
} catch (Type V){
}


Repository:
  rZORG LLVM Github Zorg

https://reviews.llvm.org/D86673

Files:
  llvm/lib/CodeGen/StackColoring.cpp
  llvm/test/CodeGen/X86/StackColoring-first-use-in-catch.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86673.288169.patch
Type: text/x-patch
Size: 16512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/d9b77a33/attachment.bin>


More information about the llvm-commits mailing list