Fix Issue #10022. (#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)
commit9b342387cd8e75249609d30ab79f05193f714e80
treed941ab61e592176cc653fe0dd0e6f74545bad97e
parent5e03cb09e3754e4a3430ba424a1352b9c01ff098
Fix Issue #10022. (#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.
src/jit/flowgraph.cpp
src/jit/lower.cpp