Skip to content

Commit 5cdd17f

Browse files
ShortDevelopmentrhuanjl
authored andcommitted
Fix this==nullptr in Clang
Provide a workaround for Clang deleting a check for `this==Empty()`, where `Empty()` returns null. Fixes #6847
1 parent 5249f3d commit 5cdd17f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Common/DataStructures/ImmutableList.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#pragma once
@@ -748,10 +749,12 @@ namespace regex
748749
return result;
749750
}
750751

752+
bool __attribute__((noinline)) CheckNull( void* obj ) { return obj == nullptr; }
753+
751754
// Info: Return true if the list is empty.
752755
bool IsEmpty()
753756
{
754-
return this==Empty();
757+
return CheckNull(this);
755758
}
756759

757760
// Info: Return a list containing the given single value

0 commit comments

Comments
 (0)