Page MenuHomePhabricator

steakhal (Balázs Benics)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 7 2019, 1:49 AM (212 w, 2 d)

Recent Activity

Thu, Mar 23

steakhal added a comment to D146538: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists.

This has been backported to clang-16.0.1 as 1172ed57d8234990b277281b3084969fcdb38602

Thu, Mar 23, 7:39 AM · Restricted Project, Restricted Project

Wed, Mar 22

steakhal added a comment to D146538: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists.

Speaking of issue tracking, I think it would be much more valuable to our users if we had a proper release notes section for CSA. Right now it is so ad-hoc.
That is also true for crash fixes and backports. Maybe we should put more emphasis on that part for the next major release.
I'm not sure how to enforce it though.

Wed, Mar 22, 1:54 AM · Restricted Project, Restricted Project
steakhal committed rG558b46fde2db: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists (authored by steakhal).
[analyzer] Fix crashing getSValFromInitListExpr for nested initlists
Wed, Mar 22, 12:44 AM · Restricted Project, Restricted Project
steakhal closed D146538: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists.
Wed, Mar 22, 12:44 AM · Restricted Project, Restricted Project

Tue, Mar 21

steakhal added a comment to D146538: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists.

Ugh :/

I wonder if we should also open tickets on GitHub to reduce the chance of forgetting addressing the root cause for these. What do you think?

Tue, Mar 21, 10:16 AM · Restricted Project, Restricted Project
steakhal added a comment to D146538: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists.

I think this one also deserves backporting to clang-16.0.1 @xazax.hun

Tue, Mar 21, 9:16 AM · Restricted Project, Restricted Project
steakhal requested review of D146538: [analyzer] Fix crashing getSValFromInitListExpr for nested initlists.
Tue, Mar 21, 9:13 AM · Restricted Project, Restricted Project

Thu, Mar 16

steakhal added a comment to D146194: NOT report the warning that unnamed bitfields are uninitialized..

BTW we request full context for git patches. That way the reviewer can scroll and see the context around your hunks.
You can request git to emit the full context by passing the -U999999 commandline option. See.

Thu, Mar 16, 6:04 AM · Restricted Project, Restricted Project
steakhal added a comment to D146194: NOT report the warning that unnamed bitfields are uninitialized..

Okay, thanks for clarifying.

Thu, Mar 16, 5:59 AM · Restricted Project, Restricted Project
steakhal requested changes to D146194: NOT report the warning that unnamed bitfields are uninitialized..

Thanks for looking into this.

Thu, Mar 16, 3:03 AM · Restricted Project, Restricted Project

Tue, Mar 7

steakhal added a comment to D144780: Explicit cast on customized offsetof should not be ignored when evaluating as const.

As this resolves a crash, I'm backporting it: https://github.com/llvm/llvm-project/issues/61245

Tue, Mar 7, 9:16 AM · Restricted Project, Restricted Project

Mon, Mar 6

steakhal committed rG53f75425b3fe: [analyzer] Explicit cast on customized offsetof should not be ignored when… (authored by danix800).
[analyzer] Explicit cast on customized offsetof should not be ignored when…
Mon, Mar 6, 11:45 PM · Restricted Project, Restricted Project
steakhal added a comment to D144780: Explicit cast on customized offsetof should not be ignored when evaluating as const.

Ah sorry that it took me so long to push this. I completely forgot about this one.

Mon, Mar 6, 11:45 PM · Restricted Project, Restricted Project
steakhal closed D144780: Explicit cast on customized offsetof should not be ignored when evaluating as const.
Mon, Mar 6, 11:45 PM · Restricted Project, Restricted Project
steakhal added a comment to D144546: [clang][dataflow] Fix assert for CXXConstructExpr argument number.

FYI the release schedule is here: https://llvm.org/docs/HowToReleaseLLVM.html#annual-release-schedule

Mon, Mar 6, 8:33 AM · Restricted Project, Restricted Project
steakhal added a comment to D144546: [clang][dataflow] Fix assert for CXXConstructExpr argument number.

By looking at the title, I get the impression that this fixes an assertion violation.
I also observed that this commit is part of main but not part of release/16.x, hence the clang-16 would be released without this fix.

I want to raise awareness of backporting crash fixes to llvm releases. IMO that's a good practice.
So my question is, should we backport this patch to the release branch?

If so, could you please check if there are more commits like this for the dataflow library @ymandel?

I used git log release/16.x..main --oneline clang/lib/{Analysis,AST,ASTMatchers,StaticAnalyzer} clang/include/clang/{Analysis,AST,ASTMatchers,StaticAnalyzer} | grep -i 'crash\|fix\|assert' to check for relevant commits.

Yes, this could be backported. I'm happy to look out for this in the future, but I don't seem to have release/16.x in my git repo -- please let me know how to pull that in. I'm only responsible for Analysis/FlowSensitive, but even just there not all fixes have those search terms in there commit message.

Mon, Mar 6, 8:23 AM · Restricted Project, Restricted Project

Fri, Mar 3

steakhal added a comment to D144546: [clang][dataflow] Fix assert for CXXConstructExpr argument number.

By looking at the title, I get the impression that this fixes an assertion violation.
I also observed that this commit is part of main but not part of release/16.x, hence the clang-16 would be released without this fix.

Fri, Mar 3, 7:29 AM · Restricted Project, Restricted Project
steakhal added a comment to D142384: [C++20] Fix a crash with modules..

@usaxena95 @ilya-biryukov, @hans, I wonder if we should backport this change to release/16.x. Otherwise, clang-16 won't have this fix. WDYT?
I'm also a bit worried that we don't have tests. And that we have "unexpected" sideeffects like what you mentioned @hans.

Fri, Mar 3, 7:22 AM · Restricted Project, Restricted Project
steakhal added a comment to D142328: [clang][Interp] Fix compound assign operator types.

Hi @tbaeder, I was looking for commits that mentions "fix" "assertion" or "crash" in the title, that are part of the main branch but not backported to release/16.x to be eventually released as clang-16.
I wonder what's the status of this and the related patches given that the commit that the summary mentions (490e8214fca48824beda8b508d6d6bbbf3d8d9a7) is present in release/16.x. I can also see that quite a few revert commits are also related to Interp.
It's probably the case that the mentioned change was removed from clang-16 by f6ea1af9a4b71d27de2dde629224af1220c5c85b.

Fri, Mar 3, 7:06 AM · Restricted Project, Restricted Project
steakhal added a comment to D142627: [analyzer] Fix crash exposed by D140059.

I'm backporting this to clang-16.
https://github.com/llvm/llvm-project/issues/61149

Fri, Mar 3, 12:03 AM · Restricted Project, Restricted Project, Restricted Project

Mar 2 2023

steakhal added a comment to D138539: Use std::nullopt_t instead of NoneType (NFC).

Hm, it would be easier to use llvm::StringMap<decltype(std::monostate)> instead of std::nullopt_t, or some adhoc empty struct.

Mar 2 2023, 5:04 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project
steakhal added a comment to D138539: Use std::nullopt_t instead of NoneType (NFC).

Oh, I forgot to mention why this change breaks the equality operator of llvm::StringSet. It's because the StringMap::operator== will try to compare the value as well, which is of type std::nullopt_t and that has no equality comparison operator.
Previously, the enum class NoneType has a default one.

Mar 2 2023, 4:25 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project
steakhal added a comment to D138539: Use std::nullopt_t instead of NoneType (NFC).

This patch breaks llvm::StringSet equality.
The following code would no longer compile:

llvm::StringSet LHS;
llvm::StringSet RHS;
bool equal = LHS == RHS;

Such code might be used as gtest assertions like EXPECT_EQ(LHS, RHS).
@kazu Do you think we should address this by providing an equality operator for the StringSet?
I was thinking of adding this:

bool operator==(const StringSet &RHS) const {
  if (Base::size() != RHS.size())
    return false;
Mar 2 2023, 4:23 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project
steakhal added a comment to D138713: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions.

I think we should backport this to release/16.x.
Here is the ticket for it: https://github.com/llvm/llvm-project/issues/61115

Mar 2 2023, 12:57 AM · Restricted Project, Restricted Project

Mar 1 2023

steakhal added a comment to D140891: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats..

I'm proposing to backport this fix to clang-16.
https://github.com/llvm/llvm-project/issues/61097

Mar 1 2023, 8:18 AM · Restricted Project, Restricted Project

Feb 27 2023

steakhal added a comment to D144269: [Analyzer] Show "taint originated here" note of alpha.security.taint.TaintPropagation checker at the correct place.

If we worry about having taint-related reports without a Note message explaining where the taint was introduced, we could just assert that in a BugReportVisitor at the finalizeVisitor() callback. I think such an assertion would make a lot of sense.
To achieve this, we could take the R.getNotes() and check if any of them refers to a specific one produced by the NoteTag callback for taint sources, let's say TaintSourceTag for that PathDiagnosticNotePiece.

Feb 27 2023, 3:09 AM · Restricted Project, Restricted Project
steakhal added a comment to D144780: Explicit cast on customized offsetof should not be ignored when evaluating as const.

I love it. Short, to the point. Thanks.
I think this is the right way to fix this.
Good job.
Can you merge the change? Or should I do it on you behalf?

I've no permission to merge, please do it for me. Thanks!

Feb 27 2023, 2:53 AM · Restricted Project, Restricted Project
steakhal added a comment to D144269: [Analyzer] Show "taint originated here" note of alpha.security.taint.TaintPropagation checker at the correct place.

First and foremost, I want to deeply apologize about my rushed response. When I say that the Taint originated here note remained, I wrongly draw conclusions. Won't happen again.

Feb 27 2023, 2:49 AM · Restricted Project, Restricted Project
steakhal accepted D144780: Explicit cast on customized offsetof should not be ignored when evaluating as const.

I love it. Short, to the point. Thanks.
I think this is the right way to fix this.
Good job.
Can you merge the change? Or should I do it on you behalf?

Feb 27 2023, 1:00 AM · Restricted Project, Restricted Project

Feb 21 2023

steakhal added a comment to D144269: [Analyzer] Show "taint originated here" note of alpha.security.taint.TaintPropagation checker at the correct place.

I haven't checked the implementation, but fundamentally patching the TaintBugVisitor is not how we should improve the diagnostic for taint issues.
I saw that this patch is not about NoteTags, so I didn't go any further that point.

Feb 21 2023, 9:17 AM · Restricted Project, Restricted Project

Feb 20 2023

steakhal added a comment to D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.

I'm backporting this as #60834 to the 16.x branch.

Feb 20 2023, 1:06 AM · Restricted Project, Restricted Project

Feb 17 2023

steakhal added a comment to D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.

I am ok with committing this to unblock people hitting this assert, but at the same time I wonder if we want to open a ticket on GitHub that we might want to rethink how some of this works.

Feb 17 2023, 3:01 AM · Restricted Project, Restricted Project
steakhal added a comment to D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.

I'm backporting this as #60834 to the 16.x branch.

Feb 17 2023, 2:43 AM · Restricted Project, Restricted Project
steakhal committed rGafcf70aa6de7: [analyzer] Remove unjustified assert from EquivalenceClass::simplify (authored by steakhal).
[analyzer] Remove unjustified assert from EquivalenceClass::simplify
Feb 17 2023, 2:38 AM · Restricted Project, Restricted Project
steakhal closed D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.
Feb 17 2023, 2:37 AM · Restricted Project, Restricted Project

Feb 12 2023

steakhal added a comment to D143867: [analyzer] Fix SARIF column location assertion crash.

The test passes on main. Are you sure about the reproducer?

This happens on versions from release/10.x to release/15.x. Since 16.x, this file gets refactored and no such problem ever.
I'm new to llvm. Are we still responsible for older versions?

We don't plan to backport a change like this to previous versions.
Thanks for your report and investigation though.

Feb 12 2023, 11:34 PM · Restricted Project, Restricted Project
steakhal added a comment to D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.

I would also suggest backporting this to the release/16.x branch as that has already branched off. WDYT?

Feb 12 2023, 11:29 PM · Restricted Project, Restricted Project
steakhal added a comment to D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.

@NoQ @xazax.hun I plan to merge this by the end of the week if you have no objection.

Feb 12 2023, 11:19 PM · Restricted Project, Restricted Project
steakhal added a comment to D143867: [analyzer] Fix SARIF column location assertion crash.

Looks sensible to me.
Do you have a test for triggering the previous assertion?

I do have prepared a test case like:

int testA(void) { return 0/0; }
// RUN: %clang_analyze_cc1 -analyzer-checker=core %s -analyzer-output=sarif -o -

Notice you must put the buggy code at the very first line to trigger the assertion.

The test passes on main. Are you sure about the reproducer?
I copy-pasted your code as-is into a test file, but check-clang-analysis still passes.

Feb 12 2023, 11:17 PM · Restricted Project, Restricted Project
steakhal added a comment to D143867: [analyzer] Fix SARIF column location assertion crash.

Looks sensible to me.
Do you have a test for triggering the previous assertion?

Feb 12 2023, 10:44 PM · Restricted Project, Restricted Project

Jan 27 2023

steakhal accepted D142607: [clang][ASTImporter] Handle UsingType in friend declarations..

LGTM

Jan 27 2023, 12:02 AM · Restricted Project, Restricted Project

Jan 26 2023

steakhal committed rG3674421c4bc0: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats (authored by tomasz-kaminski-sonarsource).
[analyzer] Fix assertion failure in SMT conversion for unary operator on floats
Jan 26 2023, 8:37 AM · Restricted Project, Restricted Project
steakhal committed rG98d55095d851: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location."… (authored by arseniy-sonar).
Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location."…
Jan 26 2023, 8:36 AM · Restricted Project, Restricted Project
steakhal closed D140891: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats..
Jan 26 2023, 8:36 AM · Restricted Project, Restricted Project
steakhal closed D138713: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions.
Jan 26 2023, 8:36 AM · Restricted Project, Restricted Project
steakhal accepted D142627: [analyzer] Fix crash exposed by D140059.

I would not mind less artificial-looking test code, but I'll let you decide if you want to make action about it.

Jan 26 2023, 7:41 AM · Restricted Project, Restricted Project, Restricted Project

Jan 25 2023

steakhal added a comment to D142354: [analyzer] Create a stub for an std::variant checker.

I would be interested in some of the free-functions dealing with variants, such as std::visit(). https://godbolt.org/z/bbocrz4dG
I hope that's also on the radar.

Jan 25 2023, 6:45 AM · Restricted Project, Restricted Project

Jan 24 2023

steakhal accepted D142454: [analyzer] Update satest dependencies.

I'm not using this docker file, so I don't mind changing it.
It probably won't hurt :D

Jan 24 2023, 6:10 AM · Restricted Project, Restricted Project
steakhal accepted D140086: [analyzer][solver] Improve reasoning for not equal to operator.

Looks good. Thanks.

Jan 24 2023, 4:42 AM · Restricted Project, Restricted Project
steakhal accepted D142439: Fix C++11 warnings in RangeSetTest.cpp.

I'm not that confident around gtest macros, but this doesn't look harmful.
Thanks for taking the time and fixing it.

Jan 24 2023, 4:36 AM · Restricted Project, Restricted Project

Jan 23 2023

steakhal added a comment to D142354: [analyzer] Create a stub for an std::variant checker.

I'm very much interrested. I think you should define a mock standard variant header, that you could include from your tests.

Jan 23 2023, 9:26 AM · Restricted Project, Restricted Project

Jan 12 2023

steakhal committed rG840edd8ab262: [analyzer] Don't escape local static memregions on bind (authored by steakhal).
[analyzer] Don't escape local static memregions on bind
Jan 12 2023, 1:43 AM · Restricted Project, Restricted Project
steakhal closed D139534: [analyzer] Don't escape local static memregions on bind.
Jan 12 2023, 1:43 AM · Restricted Project, Restricted Project

Jan 9 2023

steakhal added a comment to D140086: [analyzer][solver] Improve reasoning for not equal to operator.

Sorry, I don't have the time this week.

Jan 9 2023, 9:11 AM · Restricted Project, Restricted Project
steakhal added a comment to D139534: [analyzer] Don't escape local static memregions on bind.

Here is the gist of one *new* TP:

Where would sprops get escaped? Did I miss that or was that reduced out of the example?

Jan 9 2023, 9:10 AM · Restricted Project, Restricted Project

Jan 5 2023

steakhal added a comment to D139534: [analyzer] Don't escape local static memregions on bind.

Sorry, I got a bit swamped, will try to take a look next week. In the meantime, did you have a chance to run this over some open source projects? Did you find any interesting diffs?

Jan 5 2023, 10:14 AM · Restricted Project, Restricted Project

Jan 3 2023

steakhal added reviewers for D140891: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats.: xazax.hun, ASDenysPetrov.
Jan 3 2023, 6:01 AM · Restricted Project, Restricted Project

Jan 2 2023

steakhal added a comment to D139534: [analyzer] Don't escape local static memregions on bind.

Let me know if you have further concerns. @xazax.hun @NoQ

Jan 2 2023, 3:19 AM · Restricted Project, Restricted Project

Dec 21 2022

steakhal updated the diff for D139534: [analyzer] Don't escape local static memregions on bind.
  • Add two test cases demonstrating the false-positives this patch will introduce. These are semantically equivalent to the one mentioned in the comments by @NoQ.
Dec 21 2022, 9:15 AM · Restricted Project, Restricted Project
steakhal added a comment to D139534: [analyzer] Don't escape local static memregions on bind.

Finally, I had some time to come back to this.
Thanks for taking the time for such a detailed response, kudos! @NoQ

Dec 21 2022, 9:13 AM · Restricted Project, Restricted Project
steakhal requested changes to D140086: [analyzer][solver] Improve reasoning for not equal to operator.

Bitwidth was important because we should ideally cast smaller bitwidth type to bigger bitwidth type.
Consider if we have LHS(u8), RHS(i32), then without checking for bitwidth, we would be casting RHS's maxValue to LHS's type, which will result in lose of information and will not serve our purpose.

If you think we need that bitwidth check, why did you remove it?
I'd like to see test cases demonstrating what we are talking about and see if we want that behavior or not.

This test fails.

void testfoo(unsigned char u, signed int s) {
  if (u >= 253 && u <= 255 && s < INT_MAX - 2) {
    // u: [253, 254], s: [INT_MIN, INT_MAX - 2]
    clang_analyzer_eval(u != s); // expected-warning{{UNKNOWN}}
                                 // but returns TRUE
  }
}
Dec 21 2022, 1:10 AM · Restricted Project, Restricted Project

Dec 19 2022

steakhal added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

Hi,

The following starts crashing with this patch:

clang -cc1 -analyze -analyzer-checker=core bbi-77010.c

It crashes with

bbi-77010.c:6:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
clang: ../../clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1622: clang::ento::RangeSet (anonymous namespace)::SymbolicRangeInferrer::VisitBinaryOperator(clang::ento::RangeSet, clang::ento::RangeSet, clang::QualType): Assertion `!LHS.isEmpty() && !RHS.isEmpty() && "Both ranges should be non-empty"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Abort (core dumped)

Thanks for the report. I'll fix it ASAP.
I think I'll replace the assertion with an early return.

BTW, was this uncovered by fuzzing? @uabelho

Dec 19 2022, 4:50 AM · Restricted Project, Restricted Project
steakhal committed rGf61a08b67f5c: [analyzer] Fix crash inside RangeConstraintManager.cpp introduced by D112621 (authored by steakhal).
[analyzer] Fix crash inside RangeConstraintManager.cpp introduced by D112621
Dec 19 2022, 3:50 AM · Restricted Project, Restricted Project
steakhal added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

Hi,

The following starts crashing with this patch:

clang -cc1 -analyze -analyzer-checker=core bbi-77010.c

It crashes with

bbi-77010.c:6:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
clang: ../../clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1622: clang::ento::RangeSet (anonymous namespace)::SymbolicRangeInferrer::VisitBinaryOperator(clang::ento::RangeSet, clang::ento::RangeSet, clang::QualType): Assertion `!LHS.isEmpty() && !RHS.isEmpty() && "Both ranges should be non-empty"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Abort (core dumped)

Dec 19 2022, 3:12 AM · Restricted Project, Restricted Project

Dec 17 2022

steakhal added a comment to D140086: [analyzer][solver] Improve reasoning for not equal to operator.

About spellings. In the summary you used 'lesser', I think as a synonym for 'smaller' or something like that. Anyway, not important.
Great stuff.

Dec 17 2022, 11:57 PM · Restricted Project, Restricted Project
steakhal added a comment to D138037: [analyzer] Remove unjustified assertion from EQClass::simplify.

Hi @steakhal, thanks for the suggested change.
How we can help move this forward? From what I'm comprehending from the notes, perhaps we could try running this change through our internal systems level test and fuzzer. Unfortunately, I'd not be able to say more than "trust me, we saw no problems" if we see no problems. But if I do find additional cases I can make simplified reproducers and we can work on addressing those.
Best!

Dec 17 2022, 7:32 AM · Restricted Project, Restricted Project

Dec 16 2022

steakhal requested changes to D139604: [PATCH] Github Issue: Create a check that warns about using %p printf specifier #43453.

I appreciate that you are interested in tackling this. I do think it's a low-hanging fruit, so it's a good choice!

Dec 16 2022, 6:23 AM · Restricted Project, Restricted Project

Dec 15 2022

steakhal added a comment to D140086: [analyzer][solver] Improve reasoning for not equal to operator.

Thanks for going the extra mile to address this last thing. I really appreciate it.
I've got only a few minor comments and suggestions.

Dec 15 2022, 10:43 AM · Restricted Project, Restricted Project

Dec 13 2022

steakhal added a comment to D139881: [clang] Use a StringRef instead of a raw char pointer to store builtin and call information.

The StaticAnalyzer portion looks good to me AFAICT.

Dec 13 2022, 8:36 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project

Dec 11 2022

steakhal accepted D139759: [analyzer] Fix assertion in getAPSIntType.

The fix feels suboptimal in readability but let it be whatever.

Dec 11 2022, 2:29 PM · Restricted Project, Restricted Project
steakhal added a comment to D139759: [analyzer] Fix assertion in getAPSIntType.

Really good progress. Nicestuff. I really appreciate the unittest.
However Ive got some minor comments there :D

Dec 11 2022, 12:39 PM · Restricted Project, Restricted Project
steakhal added a comment to D139759: [analyzer] Fix assertion in getAPSIntType.

I think we could settle on something like this:

   APSIntType getAPSIntType(QualType T) const {
+    if (T->isFixedPointType())
+      return APSIntType(Ctx.getIntWidth(T), T->isUnsignedFixedPointType());
+
     // For the purposes of the analysis and constraints, we treat atomics
     // as their underlying types.
     if (const AtomicType *AT = T->getAs<AtomicType>()) {
       T = AT->getValueType();
     }
Dec 11 2022, 7:56 AM · Restricted Project, Restricted Project

Dec 10 2022

steakhal added inline comments to D139759: [analyzer] Fix assertion in getAPSIntType.
Dec 10 2022, 11:12 PM · Restricted Project, Restricted Project
steakhal requested changes to D139759: [analyzer] Fix assertion in getAPSIntType.

Nice catch.

Dec 10 2022, 11:18 AM · Restricted Project, Restricted Project

Dec 9 2022

steakhal committed rG77ab7281aa36: [analyzer][solver] Introduce reasoning for not equal to operator (authored by manas).
[analyzer][solver] Introduce reasoning for not equal to operator
Dec 9 2022, 4:34 AM · Restricted Project, Restricted Project
steakhal closed D112621: [analyzer][solver] Introduce reasoning for not equal to operator.
Dec 9 2022, 4:33 AM · Restricted Project, Restricted Project
steakhal accepted D112621: [analyzer][solver] Introduce reasoning for not equal to operator.
Dec 9 2022, 1:59 AM · Restricted Project, Restricted Project

Dec 7 2022

steakhal added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

For the test cases where we should be able to prove the case but return Unknown instead, should be marked by a FIXME stating the expected value.
Approximating a concrete value with Unknown is (almost) always correct. So, in this case, you don't need to go and fix them unless you want to do the extra mile.

Dec 7 2022, 7:23 AM · Restricted Project, Restricted Project
steakhal requested review of D139534: [analyzer] Don't escape local static memregions on bind.
Dec 7 2022, 6:19 AM · Restricted Project, Restricted Project

Dec 2 2022

steakhal planned changes to D139195: [-Wmissing-noreturn] Detect non-void noreturn function candidates.

Previously, only void returning functions were considered for noreturn attribute candidates. This patch removes this artificial restriction.

C2x 6.7.12.6p6: The implementation should produce a diagnostic message for a function declared with a noreturn attribute that appears to be capable of returning to its caller.

p7 has an example showing [[noreturn]] int h(void); with the comment "Implementations are similarly encouraged to diagnose the declaration of h() because it appears capable of returning to its caller due to the non-void return type."

So is this really an artificial restriction? To me, putting the noreturn attribute on a function with a return type makes no sense whatsoever. The interface is saying "I promise that calling me will not return" and "when I return, this is the type of the value I will give you."

Dec 2 2022, 7:56 AM · Restricted Project, Restricted Project
steakhal requested review of D139195: [-Wmissing-noreturn] Detect non-void noreturn function candidates.
Dec 2 2022, 5:39 AM · Restricted Project, Restricted Project

Nov 29 2022

steakhal added inline comments to D136811: [-Wunsafe-buffer-usage] WIP: RFC: NFC: User documentation..
Nov 29 2022, 12:33 AM · Restricted Project

Nov 28 2022

steakhal added inline comments to D137379: [-Wunsafe-buffer-usage] Add warnings for unsafe buffer accesses by array subscript operations.
Nov 28 2022, 2:22 PM · Restricted Project, Restricted Project
steakhal added inline comments to D138713: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions.
Nov 28 2022, 2:13 PM · Restricted Project, Restricted Project
steakhal committed rGdbb94b415a00: [analyzer] Remove the unused LocalCheckers.h header (authored by steakhal).
[analyzer] Remove the unused LocalCheckers.h header
Nov 28 2022, 4:09 AM · Restricted Project, Restricted Project

Nov 25 2022

steakhal added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

I haven't looked at the implementation. I only checked the tests and something is not quite right there. See my comments inline.
BTW the line-coverage is good. I found only two branches which I want to have tests for - see inline.

Nov 25 2022, 8:53 AM · Restricted Project, Restricted Project
steakhal resigned from D138713: Fix assertion failure "PathDiagnosticSpotPiece's must have a valid location." in ReturnPtrRange checker on builtin functions.

I already reviewed this internally. For me, it looks great.

Nov 25 2022, 7:08 AM · Restricted Project, Restricted Project
steakhal committed rG097ce7616527: [analyzer] Deprecate FAM analyzer-config, recommend -fstrict-flex-arrays instead (authored by steakhal).
[analyzer] Deprecate FAM analyzer-config, recommend -fstrict-flex-arrays instead
Nov 25 2022, 1:26 AM · Restricted Project, Restricted Project
steakhal committed rG36481758390c: [analyzer] Consider single-elem arrays as FAMs by default (authored by steakhal).
[analyzer] Consider single-elem arrays as FAMs by default
Nov 25 2022, 1:26 AM · Restricted Project, Restricted Project
steakhal closed D138659: [analyzer] Deprecate FAM analyzer-config, recommend -fstrict-flex-arrays instead.
Nov 25 2022, 1:25 AM · Restricted Project, Restricted Project
steakhal closed D138657: [analyzer] Consider single-elem arrays as FAMs by default.
Nov 25 2022, 1:25 AM · Restricted Project, Restricted Project

Nov 24 2022

steakhal accepted D137258: [clang] Optimize storage and lookup of analyzer options.

BTW the change itself looks good to me.

Nov 24 2022, 7:27 AM · Restricted Project, Restricted Project
steakhal accepted D138668: Correct typos.

Looks good.

Nov 24 2022, 7:21 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project
steakhal added a comment to D112621: [analyzer][solver] Introduce reasoning for not equal to operator.

Ping

Nov 24 2022, 6:41 AM · Restricted Project, Restricted Project
steakhal added a comment to D108230: [analyzer] Ignore single element arrays in getStaticSize() conditionally.

I proposed the D138657 and D138659 patches for getting rid of this flag.

Nov 24 2022, 4:48 AM · Restricted Project, Restricted Project
steakhal requested review of D138659: [analyzer] Deprecate FAM analyzer-config, recommend -fstrict-flex-arrays instead.
Nov 24 2022, 4:46 AM · Restricted Project, Restricted Project
steakhal requested review of D138657: [analyzer] Consider single-elem arrays as FAMs by default.
Nov 24 2022, 4:41 AM · Restricted Project, Restricted Project

Nov 23 2022

steakhal added inline comments to D138253: [-Wunsafe-buffer-usage] NFC: Implement fix-strategies and variable-use-claiming..
Nov 23 2022, 12:51 PM · Restricted Project, Restricted Project
steakhal added a comment to D137258: [clang] Optimize storage and lookup of analyzer options.

Are you sure about the speedup?
When I looked at the implementation of the StringSwitch, it boiled down to an if-else chain under the hood.

Nov 23 2022, 9:54 AM · Restricted Project, Restricted Project
steakhal added inline comments to D138329: [-Wunsafe-buffer-usage] Add a new recursive matcher to replace `forEachDescendant` in unsafe buffer check.
Nov 23 2022, 7:28 AM · Restricted Project, Restricted Project