Harden IR and bitcode parsers against infinite size types.
authorEli Friedman <efriedma@quicinc.com>
Sat, 16 May 2020 21:01:54 +0000 (14:01 -0700)
committerEli Friedman <efriedma@quicinc.com>
Sat, 16 May 2020 21:24:51 +0000 (14:24 -0700)
commit0ec5f501964010d4a186a51438338656eebe7912
treeae51c030a04ae561279f93496cbdb81a388dd43e
parentaccd9af838b071ff6e8ba4ff3c99a2542cd0ce25
Harden IR and bitcode parsers against infinite size types.

If isSized is passed a SmallPtrSet, it uses that set to catch infinitely
recursive types (for example, a struct that has itself as a member).
Otherwise, it just crashes on such types.
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/test/Verifier/recursive-type-load.ll [new file with mode: 0644]
llvm/test/Verifier/recursive-type-store.ll [new file with mode: 0644]