[PowerPC] Fix the EH_SjLj_Setup pseudo.
authorMarcin Koscielnicki <koriakin@0x04.net>
Thu, 28 Apr 2016 21:24:37 +0000 (21:24 +0000)
committerMarcin Koscielnicki <koriakin@0x04.net>
Thu, 28 Apr 2016 21:24:37 +0000 (21:24 +0000)
commit7b32957852475e460a9434ee903989bd4291aeaa
tree384c3e6101d1321cdb5135d514173eec09df7e92
parentde8d3753d30534d1c0df2591bc306981b50ec246
[PowerPC] Fix the EH_SjLj_Setup pseudo.

This instruction is just a control flow marker - it should not
actually exist in the object file.  Unfortunately, nothing catches
it before it gets to AsmPrinter.  If integrated assembler is used,
it's considered to be a normal 4-byte instruction, and emitted as
an all-0 word, crashing the program.  With external assembler,
a comment is emitted.

Fixed by setting Size to 0 and handling it in MCCodeEmitter - this
means the comment will still be emitted if integrated assembler
is not used.

This broke an ASan test, which has been disabled for a long time
as a result (see the discussion on D19657).  We can reenable it
once this lands.

llvm-svn: 267943
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/test/CodeGen/PowerPC/2016-04-28-setjmp.ll [new file with mode: 0644]