Fix UB in DwarfExpression::emitLegacyZExt()
authorAdrian Prantl <aprantl@apple.com>
Tue, 25 Jan 2022 21:29:22 +0000 (13:29 -0800)
committerAdrian Prantl <aprantl@apple.com>
Wed, 26 Jan 2022 18:57:11 +0000 (10:57 -0800)
commit216002c4bb708e6d6fd1895c8ea636470961f824
treea951ec1e086486f4db4d2cc641e507bbde08b1bc
parente6564f39c787d6aa06ad5573e55db3439ed3a263
Fix UB in DwarfExpression::emitLegacyZExt()

A shift-left > 63 triggers a UBSAN failure. This patch kicks the can
down the road (to the consumer) by emitting a more compact
representation of the shift computation in DWARF expressions.

Differential Revision: https://reviews.llvm.org/D118183
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
llvm/test/DebugInfo/X86/convert-debugloc.ll