Handle VectorOrTensorType parse failure instead of crashing
authorSmit Hinsu <hinsu@google.com>
Sat, 10 Nov 2018 05:24:37 +0000 (21:24 -0800)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 20:54:10 +0000 (13:54 -0700)
commit8946854128e9f22965d03a75623a27eac8634807
treef94f46ac12259aa98eb87d5976a9ce601d9c5000
parentf8f723cf02cd72e1ab670d8ba2e9d681431911af
Handle VectorOrTensorType parse failure instead of crashing

This was unsafe after cr/219372163 and seems to be the only such case in the
change. All other usage of dyn_cast are either handling the nullptr or are
implicitly safe.  For example, they are being extracted from operand or result
SSAValue.

TESTED with unit test

PiperOrigin-RevId: 220905942
mlir/lib/Parser/Parser.cpp
mlir/test/IR/invalid.mlir