diff options
author | Tim Lange <mail@tim-lange.me> | 2022-09-04 21:07:14 +0200 |
---|---|---|
committer | Tim Lange <mail@tim-lange.me> | 2022-09-05 16:22:57 +0200 |
commit | 0a9c0d4ae5519c404682425da9522c46c38712fd (patch) | |
tree | 86e3c426e4cdc483f544792e7ba90ee7a60144de /gcc/fortran/trans-openmp.cc | |
parent | 1cc7e31c41a555c53d6f0a88ecd71bbf09b9dd8d (diff) | |
download | gcc-0a9c0d4ae5519c404682425da9522c46c38712fd.zip gcc-0a9c0d4ae5519c404682425da9522c46c38712fd.tar.gz gcc-0a9c0d4ae5519c404682425da9522c46c38712fd.tar.bz2 |
analyzer: strcpy semantics
This patch adds modelling for the semantics of strcpy in the simple case
where the analyzer is able to infer a concrete string size.
Regrtested on Linux x86_64.
2022-09-04 Tim Lange <mail@tim-lange.me>
gcc/analyzer/ChangeLog:
* region-model-impl-calls.cc (region_model::impl_call_strcpy):
Handle the constant string case.
* region-model.cc (region_model::get_string_size):
New function to get the string size from a region or svalue.
* region-model.h (class region_model): Add get_string_size.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/out-of-bounds-4.c: New test.
* gcc.dg/analyzer/strcpy-3.c: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.cc')
0 files changed, 0 insertions, 0 deletions