Fix Issue dotnet/coreclr#10022. (dotnet/coreclr#10587)
authorPat Gavlin <pgavlin@gmail.com>
Thu, 30 Mar 2017 22:02:10 +0000 (15:02 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Mar 2017 22:02:10 +0000 (15:02 -0700)
commit15cde1fd7bd863da1b34ebd89e9f98fccf9ba6fb
treef743c6779d2c3306fc92e82af302d0159d80e8c8
parent56dd1fcc4355e5dd885f0709377a8ecead060cb2
Fix Issue dotnet/coreclr#10022. (dotnet/coreclr#10587)

This issue occurred because the JIT currently inserts the P/Invoke
method prolog into the first block of a function without ensuring that
this block will only execute once. This is not safe, as executing the
P/Invoke prolog multiple times can create cycles in the frame list and
casue the stack unwinder to hang.

This change ensures that lowering inserts a new, single-entry basic
block at the beginning of the function for functions that require P/Invoke prologs.

Commit migrated from https://github.com/dotnet/coreclr/commit/9b342387cd8e75249609d30ab79f05193f714e80
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/lower.cpp