[PATCH] D91960: [llvm][unittests] Fix protential nullptr dereferences due to unchecked return value or EXPECT_* macro

Ella Ma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 05:15:30 PST 2020

OikawaKirie added a comment.

Some of my fixes still need to be improved (see the comments in the code). If any reviewers have better ideas, I will update the patch.


Comment at: llvm/unittests/Analysis/VectorFunctionABITest.cpp:76
     // `invokeParser` multiple times in the same test.
     reset(Name, IRType);
Please note that. In function `invokeParser`, it will still crash after the call here. Since I do not know how to arrange a proper return value, I made no changes here. If any reviewers have any ideas about the problem, I will fix the problem here.

Comment at: llvm/unittests/Transforms/IPO/AttributorTestBase.h:44
+    }();
     return *M;
The same problem also appears here. It would be better if this function returns a pointer rather than a reference. But a lot of places related to it need to be changed. Therefore, I just leave it as it is.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list