Re: [clang] 4e3d462 - Fix undefined behaviour when trying to deref nullptr.

2020-06-09 Thread Alexey Bataev via cfe-commits
Yes, it was revealed by the tests in ubsan testbot.

Best regards,
Alexey Bataev

> 8 июня 2020 г., в 21:10, David Blaikie  написал(а):
> 
> Is this covered by existing tests?
> 
>> On Thu, Jun 4, 2020 at 2:52 PM Alexey Bataev via cfe-commits
>>  wrote:
>> 
>> 
>> 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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 4e3d462 - Fix undefined behaviour when trying to deref nullptr.

2020-06-08 Thread David Blaikie via cfe-commits
Is this covered by existing tests?

On Thu, Jun 4, 2020 at 2:52 PM Alexey Bataev via cfe-commits
 wrote:
>
>
> 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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits