[Bitcode] Drop invalid branch_weight in BitcodeReader
authorSteven Wu <stevenwu@apple.com>
Thu, 23 Jul 2020 16:06:47 +0000 (09:06 -0700)
committerSteven Wu <stevenwu@apple.com>
Thu, 23 Jul 2020 16:07:15 +0000 (09:07 -0700)
commit78709345fb343123020a8615325f3943bd1cb420
tree88391503e60d202823448eb0ed437324ad656934
parent831ae45e3dc609e43ba561af07670a8fe47461ef
[Bitcode] Drop invalid branch_weight in BitcodeReader

Summary:
If bitcode reader gets an invalid branch weight, drop that from the
inputs. This allows us to read the broken modules we generated before
the verifier was able to catch this.

rdar://64870641

Reviewers: yrouban, t.p.northover, dexonsmith, arphaman, aprantl

Reviewed By: aprantl

Subscribers: aprantl, hiraditya, jkorous, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83699
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/test/Bitcode/Inputs/branch-weight.bc [new file with mode: 0644]
llvm/test/Bitcode/branch-weight.ll [new file with mode: 0644]