Fix bug converting BBJ_CALLFINALLY block to BBJ_THROW on ARM32 (#13094)
authorBruce Forstall <brucefo@microsoft.com>
Sat, 29 Jul 2017 18:46:42 +0000 (11:46 -0700)
committerGitHub <noreply@github.com>
Sat, 29 Jul 2017 18:46:42 +0000 (11:46 -0700)
commit13e392970013a7bbae8cfe2a2c8fccb114e78bd4
tree67d515b8d94ad20fd50b6ce599c8967d318ac3b5
parent6a02f071e33499994a06c18622b46ffa6947f22f
Fix bug converting BBJ_CALLFINALLY block to BBJ_THROW on ARM32 (#13094)

* Fix bug converting BBJ_CALLFINALLY block to BBJ_THROW on ARM32

On ARM32, the target block of a return from a finally (aka, the
"continuation") is marked by a bit, `BBF_FINALLY_TARGET`, that is
used to generate proper code to ensure correct unwinding behavior.
This bit is set in the importer, and maintained through to codegen.
We assert if we attempt to delete a block with this bit. Thus, various
code that deletes dead code needs to call fgClearFinallyTargetBit()
to keep the bit updated.

This bug is a case where very early in morph, a BBJ_CALLFINALLY
block is converted to a BBJ_THROW. We should be able to just call
fgClearFinallyTargetBit(), but that function depends on the predecessor
lists, which in this case, haven't yet been built. So, instead, clear
the bits everywhere, and then recompute them at the end of morph.
This is similar to what is done with the various try/finally
optimizations done at the beginning of morph.

(It's an open question about whether we could avoid setting the bits
at all until just before codegen.)

Fixes VSO468731

No diffs in desktop altjit asm diffs.

* Formatting
src/jit/compiler.h
src/jit/compiler.hpp
src/jit/flowgraph.cpp
src/jit/morph.cpp