History log of /llvm-project/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp (Results 1 – 25 of 108)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# b41240be 19-Dec-2024 Balazs Benics <benicsbalazs@gmail.com>

[analyzer][NFC] Introduce APSIntPtr, a safe wrapper of APSInt (1/4) (#120435)

One could create dangling APSInt references in various ways in the past, that were sometimes assumed to be persisted in

[analyzer][NFC] Introduce APSIntPtr, a safe wrapper of APSInt (1/4) (#120435)

One could create dangling APSInt references in various ways in the past, that were sometimes assumed to be persisted in the BasicValueFactor.

One should always use BasicValueFactory to create persistent APSInts, that could be used by ConcreteInts or SymIntExprs and similar long-living objects.
If one used a temporary or local variables for this, these would dangle.
To enforce the contract of the analyzer BasicValueFactory and the uses of APSInts, let's have a dedicated strong-type for this.

The idea is that APSIntPtr is always owned by the BasicValueFactory, and that is the only component that can construct it.

These PRs are all NFC - besides fixing dangling APSInt references.

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# 8d43c880 15-Nov-2024 Balazs Benics <benicsbalazs@gmail.com>

Revert "[analyzer][Solver] Early return if sym is concrete on assuming" (#116362)

Reverts llvm/llvm-project#115579

This introduced a breakage:
https://lab.llvm.org/buildbot/#/builders/46/builds/

Revert "[analyzer][Solver] Early return if sym is concrete on assuming" (#116362)

Reverts llvm/llvm-project#115579

This introduced a breakage:
https://lab.llvm.org/buildbot/#/builders/46/builds/7928

show more ...


# 4163136e 15-Nov-2024 Ding Fei <fding@feysh.com>

[analyzer][Solver] Early return if sym is concrete on assuming (#115579)

This could deduce some complex syms derived from simple ones whose
values could be constrainted to be concrete during execut

[analyzer][Solver] Early return if sym is concrete on assuming (#115579)

This could deduce some complex syms derived from simple ones whose
values could be constrainted to be concrete during execution, thus
reducing some overconstrainted states.

This commit also fix `unix.StdCLibraryFunctions` crash due to these
overconstrainted states being added to the graph, which is marked as
sink node (PosteriorlyOverconstrained). The 'assume' API is used in
non-dual style so the checker should protectively test whether these
newly added nodes are actually impossible.

1. The crash: https://godbolt.org/z/8KKWeKb86
2. The solver needs to solve equivalent: https://godbolt.org/z/ed8WqsbTh

show more ...


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 9ce4af5c 29-Aug-2024 Rahul Joshi <rjoshi@nvidia.com>

Revert "Revert "[Support] Validate number of arguments passed to formatv()"" (#106592)

Reverts llvm/llvm-project#106589
The fix for bot failures caused by the reverted commit was committed
already

Revert "Revert "[Support] Validate number of arguments passed to formatv()"" (#106592)

Reverts llvm/llvm-project#106589
The fix for bot failures caused by the reverted commit was committed
already, so this revert is not needed.

show more ...


# ed37b5f6 29-Aug-2024 Mehdi Amini <joker.eph@gmail.com>

Revert "[Support] Validate number of arguments passed to formatv()" (#106589)

Reverts llvm/llvm-project#105745

Some bots are broken apparently.


# fc110202 29-Aug-2024 Rahul Joshi <rjoshi@nvidia.com>

[Support] Validate number of arguments passed to formatv() (#105745)

Change formatv() to validate that the number of arguments passed matches
number of replacement fields in the format string, and

[Support] Validate number of arguments passed to formatv() (#105745)

Change formatv() to validate that the number of arguments passed matches
number of replacement fields in the format string, and that the replacement
indices do not contain holes.

To support cases where this cannot be guaranteed, introduce a formatv()
overload that allows disabling validation with a bool flag as its first argument.

show more ...


Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 5997ebdb 28-Jun-2024 Balazs Benics <benicsbalazs@gmail.com>

[analyzer][NFC] Use ArrayRef for input parameters (#93203)

Fixes #79684


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4
# cf7d36fe 08-Apr-2024 Zentrik <Zentrik@users.noreply.github.com>

[NFC] Fix misspellings of effects (#87795)


Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4
# 1246b64f 21-Feb-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][analyzer] Change modeling of 'fileno' in checkers. (#81842)

Function 'fileno' fails only if invalid pointer is passed, this is a
case that is often ignored in source code. The failure case

[clang][analyzer] Change modeling of 'fileno' in checkers. (#81842)

Function 'fileno' fails only if invalid pointer is passed, this is a
case that is often ignored in source code. The failure case leads to
many "false positive" reports when `fileno` returns -1 and this is not
checked in the program. Because this, the function is now assumed
to not fail (this is assumption that the passed file pointer is correct).
The change affects `StdCLibraryFunctionsChecker` and
`StreamChecker`.

show more ...


Revision tags: llvmorg-18.1.0-rc3
# b85fe40c 08-Feb-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (#76979)

Some stream functions were recently added to `StreamChecker` that were
not modeled by `StdCLibraryFunc

[clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (#76979)

Some stream functions were recently added to `StreamChecker` that were
not modeled by `StdCLibraryFunctionsChecker`. To ensure consistency
these functions are added to the other checker too.
Some of the related tests are re-organized.

show more ...


Revision tags: llvmorg-18.1.0-rc2
# c12f30c7 31-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Improve modeling of 'realpath' in StdLibraryFunctionsChecker (#79939)


Revision tags: llvmorg-18.1.0-rc1
# ff05c308 27-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Improve modeling of 'popen' and 'pclose' in StdLibraryFunctionsChecker (#78895)


# b7f986d9 25-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Improve modeling of 'execv' and 'execvp' in StdLibraryFunctionsChecker (#78930)

These functions always return -1 and set 'errno'.


Revision tags: llvmorg-19-init
# 1d9a65b2 22-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer][NFC] Simplify ranges in StdLibraryFunctionsChecker (#78886)


# 02232307 20-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Improve modeling of 'fdopen' in StdLibraryFunctionsChecker (#78680)


# da6806dc 16-Jan-2024 Ben Shi <2283975856@qq.com>

Improve modeling of two functions in StdLibraryFunctionsChecker (#78079)

Improve 'errno' modeling of 'opendir' and 'fdopendir'.


# 27d963a7 16-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Improve modeling of 'fseeko' and 'ftello' in StdLibraryFunctionsChecker (#77902)


# 66d022f3 11-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Fix incorrect range of 'ftell' in the StdLibraryFunctionsChecker (#77576)

According to https://pubs.opengroup.org/onlinepubs/9699919799/, the
return value of `ftell` is not restri

[clang][analyzer] Fix incorrect range of 'ftell' in the StdLibraryFunctionsChecker (#77576)

According to https://pubs.opengroup.org/onlinepubs/9699919799/, the
return value of `ftell` is not restricted to `> 0`, and may return `0`
in real world.

show more ...


# 8f78dd4b 10-Jan-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][analyzer] Add function 'ungetc' to StreamChecker. (#77331)

`StdLibraryFunctionsChecker` is updated too with `ungetc`.


# 7dd20637 09-Jan-2024 Ben Shi <2283975856@qq.com>

Improve modeling of 'getcwd' in the StdLibraryFunctionsChecker (#77040)

1. Improve the 'errno' modeling.
2. Improve constraints of the arguments.


# 3db749af 03-Jan-2024 Ben Shi <2283975856@qq.com>

[clang][analyzer] Improve 'errno' modeling of 'mkdtemp' (#76671)


# 18f219c5 01-Jan-2024 Balazs Benics <benicsbalazs@gmail.com>

[analyzer][NFC] Cleanup BugType lazy-init patterns (#76655)

Cleanup most of the lazy-init `BugType` legacy.
Some will be preserved, as those are slightly more complicated to
refactor.

Notice, t

[analyzer][NFC] Cleanup BugType lazy-init patterns (#76655)

Cleanup most of the lazy-init `BugType` legacy.
Some will be preserved, as those are slightly more complicated to
refactor.

Notice, that the default category for `BugType` is `LogicError`. I
omitted setting this explicitly where I could.

Please, actually have a look at the diff. I did this manually, and we
rarely check the bug type descriptions and stuff in tests, so the
testing might be shallow on this one.

show more ...


# 925ff9e1 30-Dec-2023 Ben Shi <2283975856@qq.com>

[clang][analyzer] Support 'fflush' in the StdLibraryFunctionsChecker (#76557)

Co-authored-by: Balazs Benics <benicsbalazs@gmail.com>


Revision tags: llvmorg-17.0.6
# f8e8530f 16-Nov-2023 Kazu Hirata <kazu@google.com>

[StaticAnalyzer] Fix warnings about missing override

This patch fixes:

clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:609:23:
error: 'describe' overrides a member function but

[StaticAnalyzer] Fix warnings about missing override

This patch fixes:

clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:609:23:
error: 'describe' overrides a member function but is not marked
'override' [-Werror,-Winconsistent-missing-override]

clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:627:23:
error: 'describe' overrides a member function but is not marked
'override' [-Werror,-Winconsistent-missing-override]

show more ...


# 699e1019 16-Nov-2023 Balázs Kéri <balazs.keri@ericsson.com>

[clang][analyzer] Improve 'errno' handling in StdLibraryFunctionsChecker. (#71392)

The checker now displays one combined note tag for errno-related and
"case"-related notes. Previous functions in t

[clang][analyzer] Improve 'errno' handling in StdLibraryFunctionsChecker. (#71392)

The checker now displays one combined note tag for errno-related and
"case"-related notes. Previous functions in the errno-modeling part that
were used for construction of note tags are removed. The note tag added
by StdLibraryFunctionsChecker contains the code to display the note tag
for 'errno' (this was done previously by these removed functions).

show more ...


12345