Author: Alexey Bataev Date: 2020-06-04T17:52:06-04:00 New Revision: 4e3d4622b1e7bd419815510e5f7cd0f96595b2a3
URL: https://github.com/llvm/llvm-project/commit/4e3d4622b1e7bd419815510e5f7cd0f96595b2a3 DIFF: https://github.com/llvm/llvm-project/commit/4e3d4622b1e7bd419815510e5f7cd0f96595b2a3.diff LOG: Fix undefined behaviour when trying to deref nullptr. Added: Modified: clang/lib/CodeGen/CodeGenFunction.h Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 2b0ebad3088e..cfd9950066bb 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -684,18 +684,18 @@ class CodeGenFunction : public CodeGenTypeCache { /// Manages parent directive for scan directives. class ParentLoopDirectiveForScanRegion { CodeGenFunction &CGF; - const OMPExecutableDirective &ParentLoopDirectiveForScan; + const OMPExecutableDirective *ParentLoopDirectiveForScan; public: ParentLoopDirectiveForScanRegion( CodeGenFunction &CGF, const OMPExecutableDirective &ParentLoopDirectiveForScan) : CGF(CGF), - ParentLoopDirectiveForScan(*CGF.OMPParentLoopDirectiveForScan) { + ParentLoopDirectiveForScan(CGF.OMPParentLoopDirectiveForScan) { CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan; } ~ParentLoopDirectiveForScanRegion() { - CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan; + CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan; } }; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits