https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121768
From da2bbf99b8430d8b6aa6bf7969c9825b4d94219b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 18 Nov 2024 11:36:03 +0100
Subject: [PATCH 1/5] [
@@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
NonTypeTemplateParmDecl *NewConstrainedParm,
NonTypeTemplateParmDecl *OrigConstrainedParm,
SourceLocation Elli
@@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
NonTypeTemplateParmDecl *NewConstrainedParm,
NonTypeTemplateParmDecl *OrigConstrainedParm,
SourceLocation Elli
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
<< NewConstrainedParm->getTypeSourceInfo()
->getTypeLoc()
.getSourceRange();
+NewConstrainedParm->setPlaceholderTypeConstraint(
+RecoveryExpr::Create(Contex
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121768
From da2bbf99b8430d8b6aa6bf7969c9825b4d94219b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 18 Nov 2024 11:36:03 +0100
Subject: [PATCH 1/3] [
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
<< NewConstrainedParm->getTypeSourceInfo()
->getTypeLoc()
.getSourceRange();
+NewConstrainedParm->setPlaceholderTypeConstraint(
+RecoveryExpr::Create(Contex
@@ -0,0 +1,54 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: cd %t
+
+// RUN: %clang_cc1 -std=c++20 mod.cppm -emit-module-interface -o mod.pcm
-fallow-pcm-with-compiler-errors -verify
+// RUN: %clang_cc1 -std=c++20 main.cpp -fmodule-file=mod=mod.pcm -verify
-fallow-pcm
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
<< NewConstrainedParm->getTypeSourceInfo()
->getTypeLoc()
.getSourceRange();
+NewConstrainedParm->setPlaceholderTypeConstraint(
+RecoveryExpr::Create(Contex
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121768
From da2bbf99b8430d8b6aa6bf7969c9825b4d94219b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 18 Nov 2024 11:36:03 +0100
Subject: [PATCH 1/2] [
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/121768
...when there are invalid constraints.
When attaching a `TypeConstraint`, in case of error, the trailing pointer that
is supposed to point to the constraint is left uninitialized.
Sometime
alejandro-alvarez-sonarsource wrote:
Thanks for the review! Would you mind doing the merge? I do not have permission.
https://github.com/llvm/llvm-project/pull/121550
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/6] [c
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/6] [c
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/7] [c
@@ -7230,6 +7230,9 @@ void ASTWriter::CompletedImplicitDefinition(const
FunctionDecl *D) {
if (!D->isFromASTFile())
return; // Declaration not imported from PCH.
+ if (!D->doesThisDeclarationHaveABody())
+return; // The function definition may not have a body due t
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/6] [c
@@ -6092,12 +6092,14 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext
&Context,
// An updated body is emitted last, so that the reader doesn't need
// to skip over the lazy body to reach statements for other records.
- if (Kind == UPD_CXX_ADDED_FUNCTION_D
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/5] [c
@@ -6092,9 +6092,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext
&Context,
// An updated body is emitted last, so that the reader doesn't need
// to skip over the lazy body to reach statements for other records.
- if (Kind == UPD_CXX_ADDED_FUNCTION_DE
@@ -6092,9 +6092,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext
&Context,
// An updated body is emitted last, so that the reader doesn't need
// to skip over the lazy body to reach statements for other records.
- if (Kind == UPD_CXX_ADDED_FUNCTION_DE
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/4] [c
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/3] [c
@@ -6227,8 +6227,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext
&Context,
// Add a trailing update record, if any. These must go last because we
// lazily load their attached statement.
if (!GeneratingReducedBMI || !CanElideDeclDef(D)) {
- if (HasUpda
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/121550
From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 3 Jan 2025 08:58:23 +0100
Subject: [PATCH 1/2] [c
alejandro-alvarez-sonarsource wrote:
> You hope the linter doesn't give up `some.cc` if `mod` contains some errors?
> If yes, that makes sense to me.
Precisely.
> But why Sanitizers? IIRC, they should only work if the project compiles. Or
> are you saying the static analyzer?
Sorry, my mind
alejandro-alvarez-sonarsource wrote:
> Out of curiosity (not a blocking issue), why do you want this feature for
> C++20 modules?
Sanitizers, linters and indexers have to deal with code using non supported C++
language features or extensions. This is also true for C++20 modules. While
conceiv
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/121550
An instantiated templated function definition may not have a body due to
parsing errors inside the templated function. When serializing, an assert is
triggered inside `ASTRecordWriter::Add
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/121485
Fixes a regression introduced in commit da00c60dae0040185dc45039c4397f6e746548e9
This functionality was originally added in commit
5834996fefc937d6211dc8c8a5b200068753391a
From dcdc88688d
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/119711
From d398fa13c2fa141954c79ca68a59c6ac506b393f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 11 Dec 2024 15:43:58 +0100
Subject: [PATCH 1/4] A
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/119711
From d398fa13c2fa141954c79ca68a59c6ac506b393f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 11 Dec 2024 15:43:58 +0100
Subject: [PATCH 1/4] A
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/119711
From d398fa13c2fa141954c79ca68a59c6ac506b393f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 11 Dec 2024 15:43:58 +0100
Subject: [PATCH 1/3] A
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/119711
When a statement expression's last statement is an atomic variable, GCC and
Clang disagree on the type of the expression. This can be made apparent using
`typeof` and forcing a diagnostic
alejandro-alvarez-sonarsource wrote:
Thanks! Can you do the merge? I do not have the rights.
Also, would it make sense to backport to 19?
https://github.com/llvm/llvm-project/pull/118288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:/
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/118288
From 998ea6184faa12f6137d5b20f0a5f9279b14623a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 2 Dec 2024 10:48:52 +0100
Subject: [PATCH 1/2] [c
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/118288
...in `ASTContext::getAutoTypeInternal`
Given
```cpp
template < typename >
concept C1 = true;
template < typename , auto >
concept C2 = true;
template < C1 auto V, C2< V > auto>
struct S
alejandro-alvarez-sonarsource wrote:
> Do you need someone to commit these changes for you? (If so, I can apply the
> changes myself and land them.)
Yes, please, I can't merge myself.
https://github.com/llvm/llvm-project/pull/109147
___
cfe-commits m
@@ -141,10 +143,11 @@ struct PrintingPolicy {
unsigned SuppressUnwrittenScope : 1;
/// Suppress printing parts of scope specifiers that correspond
- /// to inline namespaces, where the name is unambiguous with the specifier
+ /// to inline namespaces.
+ /// If Redudant,
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/8] [
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/7] [
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/6] [
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/5] [
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/4] [
alejandro-alvarez-sonarsource wrote:
> > Or even SuppressInlineNamespace should be changed from bool to some enum
> > like None, Redundant, All.
>
> I think this is the suggestion I'd prefer; it's cleaner than adding a second
> boolean option.
Agreed. And changes.
> Make sure that all curre
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/3] [
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/3] [
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/2] [
alejandro-alvarez-sonarsource wrote:
Ping (@PiotrZSL ?)
https://github.com/llvm/llvm-project/pull/109147
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/110133
i.e., in `function(new Unknown);` the parser should skip only until the
semicolon.
Before this change, everything was skipped until a balanced closing parenthesis
or brace was found. This
alejandro-alvarez-sonarsource wrote:
> Also, it needs a release note I think for the matcher change.
Added.
> I have no problem with the code here, but don't know enough about ASTMatchers
> to be able to review this for 'well justified'. Do we have someone besides
> Aaron who does?
FWIW this
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/109147
From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Mon, 24 Jul 2023 13:56:29 +0200
Subject: [PATCH 1/2] [
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/109147
Add a new flag `AlwaysSuppressInlineNamespace` to `PrintingPolicy` that is
explicit
about *always* removing inline namespaces regardless of ambiguity.
Specializing a template from an inlin
alejandro-alvarez-sonarsource wrote:
Thanks! Do you mind merging the PR? I do not have permission to do so.
https://github.com/llvm/llvm-project/pull/108021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/108021
From b414b6e184fc566efd6a2dbe631ee68a25b461a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Fri, 16 Jun 2023 18:01:33 +0200
Subject: [PATCH 1/3] [
https://github.com/alejandro-alvarez-sonarsource edited
https://github.com/llvm/llvm-project/pull/108021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -446,7 +446,12 @@ static bool tryDiagnoseOverloadedCast(Sema &S, CastType CT,
: InitializationKind::CreateCast(/*type range?*/ range);
InitializationSequence sequence(S, entity, initKind, src);
- assert(sequence.Failed() && "initialization succeeded on second try?");
https://github.com/alejandro-alvarez-sonarsource edited
https://github.com/llvm/llvm-project/pull/108021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/108021
A constructor may have failed to be used due to a broken templated dependent
parameter. The `InitializationSequence` itself can succeed.
Due to the assumption that it is in a failed state,
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/96509
From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Thu, 1 Jun 2023 16:30:54 +0200
Subject: [PATCH 1/6] [Se
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/96509
From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Thu, 1 Jun 2023 16:30:54 +0200
Subject: [PATCH 1/5] [Se
alejandro-alvarez-sonarsource wrote:
> LGTM. Do you need me to merge that for you?
Yes, thanks!
https://github.com/llvm/llvm-project/pull/96509
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
alejandro-alvarez-sonarsource wrote:
> Thanks for the fix; I think this makes sense. Can you provide a release note?
Added (and fixed the conflict)
https://github.com/llvm/llvm-project/pull/96509
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/96509
From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Thu, 1 Jun 2023 16:30:54 +0200
Subject: [PATCH 1/5] [Se
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/96509
From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Thu, 1 Jun 2023 16:30:54 +0200
Subject: [PATCH 1/5] [Se
https://github.com/alejandro-alvarez-sonarsource edited
https://github.com/llvm/llvm-project/pull/96509
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc,
NamedDecl *D,
getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc));
}
QualType T = CheckTemplateIdType(TemplateName(TD), Loc, Args);
- if (T.i
@@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc,
NamedDecl *D,
getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc));
}
QualType T = CheckTemplateIdType(TemplateName(TD), Loc, Args);
- if (T.i
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/96509
From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Thu, 1 Jun 2023 16:30:54 +0200
Subject: [PATCH 1/2] [Se
alejandro-alvarez-sonarsource wrote:
Ping (@cor3ntin, @Endilll ?)
https://github.com/llvm/llvm-project/pull/96509
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/alejandro-alvarez-sonarsource created
https://github.com/llvm/llvm-project/pull/96509
When looking for a template instantiation with a non-type parameter of unknown
type and with a default value.
This can happen when a template non-type parameter has a broken expression that
alejandro-alvarez-sonarsource wrote:
Rebased and squashed into two commits that should be kept separate.
https://github.com/llvm/llvm-project/pull/83027
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From 18569fc14e2d9050acbc63c2367f9a1ec6f8577b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 1/2] [c
@@ -376,3 +377,75 @@ void fflush_on_open_failed_stream(void) {
}
fclose(F);
}
+
+void getline_null_file() {
+ char *buffer = NULL;
+ size_t n = 0;
+ getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be
NULL}}
+}
+
+void getdelim_null_file() {
+ cha
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 01/24]
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) {
}
fclose(F);
}
+
+void getline_null_file() {
+ char *buffer = NULL;
+ size_t n = 0;
+ getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be
NULL}}
+}
+
+void getdelim_null_file() {
+ ch
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 01/23]
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) {
}
fclose(F);
}
+
+void getline_null_file() {
+ char *buffer = NULL;
+ size_t n = 0;
+ getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be
NULL}}
+}
+
+void getdelim_null_file() {
+ ch
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) {
}
fclose(F);
}
+
+void getline_null_file() {
+ char *buffer = NULL;
+ size_t n = 0;
+ getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be
NULL}}
+}
+
+void getdelim_null_file() {
+ ch
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) {
}
fclose(F);
}
+
+void getline_null_file() {
+ char *buffer = NULL;
+ size_t n = 0;
+ getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be
NULL}}
+}
+
+void getdelim_null_file() {
+ ch
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) {
}
fclose(F);
}
+
+void getline_null_file() {
+ char *buffer = NULL;
+ size_t n = 0;
+ getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be
NULL}}
+}
+
+void getdelim_null_file() {
+ ch
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 01/22]
@@ -1217,6 +1231,11 @@ void StreamChecker::evalGetdelim(const FnDescription
*Desc,
E.isStreamEof() ? ErrorFEof : ErrorFEof | ErrorFError;
StateFailed = E.setStreamState(
StateFailed, StreamState::getOpened(Desc, NewES, !NewES.isFEof()));
+ // On failure, the con
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription
*Desc,
State->BindExpr(E.CE, C.getLocationContext(), RetVal);
StateNotFailed =
E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call));
+// The buffer size `*n` must
https://github.com/alejandro-alvarez-sonarsource commented:
Applied the feedback.
By the way, when `StdLibraryFunctionsChecker` is refactored, I'd be happy to
give a hand if you need updating these checkers (UnixAPI and Stream).
https://github.com/llvm/llvm-project/pull/83027
__
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 01/20]
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription
*Desc,
State->BindExpr(E.CE, C.getLocationContext(), RetVal);
StateNotFailed =
E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call));
+// The buffer size `*n` must
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription
*Desc, const CallEvent &Call,
C.addTransition(StateFailed);
}
+ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect(
+SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription
*Desc,
State->BindExpr(E.CE, C.getLocationContext(), RetVal);
StateNotFailed =
E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call));
+// The buffer size `*n` must
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 01/19]
alejandro-alvarez-sonarsource wrote:
Sorry for the force-push, but I have moved now the precondition checks to
`UnixAPIChecker` after uplifting its API (now it uses `PreCall` instead of
`PreStmt`). From my understanding, the previous implementation used a legacy
way of handling them.
The idea
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription
*Desc, const CallEvent &Call,
C.addTransition(StateFailed);
}
+ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect(
+SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription
*Desc, const CallEvent &Call,
C.addTransition(StateFailed);
}
+ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect(
+SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 20 Mar 2024 10:49:08 +0100
Subject: [PATCH 01/18]
alejandro-alvarez-sonarsource wrote:
@balazske would you agree with my proposal of keeping this logic in
`UnixAPIChecker`? I am also happy with adding more NULL checks to
`StreamChecker`, but I can understand your concerns about overreaching its
scope.
https://github.com/llvm/llvm-project/pul
alejandro-alvarez-sonarsource wrote:
> Additionally, the checked preconditions look not exact. For example the POSIX
> documentation for `getdelim` says: "If *n is non-zero, the application shall
> ensure that *lineptr either points to an object of size at least *n bytes, or
> is a null pointe
@@ -510,6 +517,14 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/83027
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription
*Desc, const CallEvent &Call,
C.addTransition(StateFailed);
}
+ProgramStateRef
+StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr,
+CheckerContext &C, P
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription
*Desc, const CallEvent &Call,
C.addTransition(StateFailed);
}
+ProgramStateRef
+StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr,
+CheckerContext &C, P
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription
*Desc, const CallEvent &Call,
C.addTransition(StateFailed);
}
+ProgramStateRef
+StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr,
+CheckerContext &C, P
https://github.com/alejandro-alvarez-sonarsource updated
https://github.com/llvm/llvm-project/pull/83027
From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?=
Date: Wed, 21 Feb 2024 14:46:01 +0100
Subject: [PATCH 01/14]
@@ -234,6 +235,9 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/83027
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 164 matches
Mail list logo