[SVE] Fix ubsan issues in DecodeIITType
authorDavid Sherwood <david.sherwood@arm.com>
Tue, 2 Jun 2020 13:44:24 +0000 (14:44 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Thu, 4 Jun 2020 06:58:24 +0000 (07:58 +0100)
commita3e3986be122bd1cdebe7f7f69c3d1c4c22c4690
treecca006b8fb61c7682d71d698abc320b5c2c35194
parent8d74de9de6d6cca552d7de7d0bfd36b6dd7d58dc
[SVE] Fix ubsan issues in DecodeIITType

In an earlier patch I removed the need for
IITDescriptor::ScalableVecArgument, which involved changing
DecodeIITType to pull out the last IIT_Info from the list. However,
it turns out this is unsafe and causes ubsan failures. I've tried to
fix this a different way by simply passing the last IIT_Info as an
additional argument to DecodeIITType.

Differential Revision: https://reviews.llvm.org/D81057
llvm/lib/IR/Function.cpp