[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread via cfe-commits

https://github.com/jyu2-git closed 
https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

Please include this fix into re-land.

https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread Alexey Bataev via cfe-commits

https://github.com/alexey-bataev approved this pull request.

LG

https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread via cfe-commits

https://github.com/jyu2-git updated 
https://github.com/llvm/llvm-project/pull/90800

>From ef84e989066318f0f7652080b471c91f8cb1360e Mon Sep 17 00:00:00 2001
From: Jennifer Yu 
Date: Wed, 1 May 2024 15:38:36 -0700
Subject: [PATCH] Fix sanitize problem.

Currently isMapType could return OpenMPMapModifierKind.

The change is to return OpenMPMapTypeKind only, if it is not MapType
Kind OMPC_MAP_unknown is returned.
---
 clang/lib/Parse/ParseOpenMP.cpp | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 53d89ce2fa3e99..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4316,7 +4316,7 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 }
 
 /// Checks if the token is a valid map-type.
-/// FIXME: It will return an OpenMPMapModifierKind if that's what it parses.
+/// If it is not MapType kind, OMPC_MAP_unknown is returned.
 static OpenMPMapClauseKind isMapType(Parser ) {
   Token Tok = P.getCurToken();
   // The map-type token can be either an identifier or the C++ delete keyword.
@@ -4326,7 +4326,11 @@ static OpenMPMapClauseKind isMapType(Parser ) {
   OpenMPMapClauseKind MapType =
   static_cast(getOpenMPSimpleClauseType(
   OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
-  return MapType;
+  if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
+  MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
+  MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)
+return MapType;
+  return OMPC_MAP_unknown;
 }
 
 /// Parse map-type in map clause.

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread via cfe-commits

jyu2-git wrote:

> > > A test?
> > 
> > 
> > I don't really know how to test this, as I don't know how to reproduce the 
> > problem. Any suggestion?
> 
> What is the problem?

https://lab.llvm.org/buildbot/#/builders/85/builds/23835



https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread Alexey Bataev via cfe-commits

alexey-bataev wrote:

> > A test?
> 
> I don't really know how to test this, as I don't know how to reproduce the 
> problem. Any suggestion?

What is the problem?

https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread via cfe-commits

jyu2-git wrote:

> A test?

I don't really know how to test this, as I don't know how to reproduce the 
problem.  Any suggestion?



https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-02 Thread Alexey Bataev via cfe-commits

alexey-bataev wrote:

A test?

https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-01 Thread via cfe-commits

https://github.com/jyu2-git unassigned 
https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-01 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: None (jyu2-git)


Changes

Currently isMapType could return OpenMPMapModifierKind.

The change is to return OpenMPMapTypeKind only, if it is not MapType Kind 
OMPC_MAP_unknown is returned.

---
Full diff: https://github.com/llvm/llvm-project/pull/90800.diff


1 Files Affected:

- (modified) clang/lib/Parse/ParseOpenMP.cpp (+6-2) 


``diff
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 53d89ce2fa3e99..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4316,7 +4316,7 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 }
 
 /// Checks if the token is a valid map-type.
-/// FIXME: It will return an OpenMPMapModifierKind if that's what it parses.
+/// If it is not MapType kind, OMPC_MAP_unknown is returned.
 static OpenMPMapClauseKind isMapType(Parser ) {
   Token Tok = P.getCurToken();
   // The map-type token can be either an identifier or the C++ delete keyword.
@@ -4326,7 +4326,11 @@ static OpenMPMapClauseKind isMapType(Parser ) {
   OpenMPMapClauseKind MapType =
   static_cast(getOpenMPSimpleClauseType(
   OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
-  return MapType;
+  if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
+  MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
+  MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)
+return MapType;
+  return OMPC_MAP_unknown;
 }
 
 /// Parse map-type in map clause.

``




https://github.com/llvm/llvm-project/pull/90800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Fix sanitize problem. (PR #90800)

2024-05-01 Thread via cfe-commits

https://github.com/jyu2-git created 
https://github.com/llvm/llvm-project/pull/90800

Currently isMapType could return OpenMPMapModifierKind.

The change is to return OpenMPMapTypeKind only, if it is not MapType Kind 
OMPC_MAP_unknown is returned.

>From ef84e989066318f0f7652080b471c91f8cb1360e Mon Sep 17 00:00:00 2001
From: Jennifer Yu 
Date: Wed, 1 May 2024 15:38:36 -0700
Subject: [PATCH] Fix sanitize problem.

Currently isMapType could return OpenMPMapModifierKind.

The change is to return OpenMPMapTypeKind only, if it is not MapType
Kind OMPC_MAP_unknown is returned.
---
 clang/lib/Parse/ParseOpenMP.cpp | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 53d89ce2fa3e99..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4316,7 +4316,7 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 }
 
 /// Checks if the token is a valid map-type.
-/// FIXME: It will return an OpenMPMapModifierKind if that's what it parses.
+/// If it is not MapType kind, OMPC_MAP_unknown is returned.
 static OpenMPMapClauseKind isMapType(Parser ) {
   Token Tok = P.getCurToken();
   // The map-type token can be either an identifier or the C++ delete keyword.
@@ -4326,7 +4326,11 @@ static OpenMPMapClauseKind isMapType(Parser ) {
   OpenMPMapClauseKind MapType =
   static_cast(getOpenMPSimpleClauseType(
   OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
-  return MapType;
+  if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
+  MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
+  MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)
+return MapType;
+  return OMPC_MAP_unknown;
 }
 
 /// Parse map-type in map clause.

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits