[PATCH] D91781: [VE] Add regression test for D91151

Kazushi Marukawa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 13:08:46 PST 2020


kaz7 added a comment.

In D91781#2406224 <https://reviews.llvm.org/D91781#2406224>, @dblaikie wrote:

> In D91781#2405239 <https://reviews.llvm.org/D91781#2405239>, @kaz7 wrote:
>
>> Hi, @dblaikie.  I generated a test case which causes a segmentation fault if we didn't apply D91151 <https://reviews.llvm.org/D91151> (https://reviews.llvm.org/D91151) following your suggestion.  I appreciate if you have more suggestions.
>
> Were you testing with assertions enabled? I'd expect a test case to cause an assertion failure (when the "cast" was applied to an object that wasn't the intended type) rather than a segmentation fault.

There is no assertions.  Original code used `cast<ConstantSDNode>` and caused segmentation fault.  I modified it to `dyn_cast<...>` in D91151 <https://reviews.llvm.org/D91151> to avoid this segmentation fault.  Then, you asked me a test case to show the segmentation fault actually happens.  Therefore, I add it this time.

You suggested `assert` before the `cast` this time.  However, this `cast` causes segmentation fault on real programs.  It means adding assertion before the cast will simply cause assertion fault on real programs.  I don't want to do that...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91781/new/

https://reviews.llvm.org/D91781



More information about the llvm-commits mailing list