diff options
author | Balazs Benics <benicsbalazs@gmail.com> | 2020-11-30 18:06:28 +0100 |
---|---|---|
committer | Balazs Benics <benicsbalazs@gmail.com> | 2020-11-30 18:06:28 +0100 |
commit | ee073c798515e56b23463391a7b40d5ee6527337 (patch) | |
tree | 907bf4fb889cc7c60c82a25956c81cf4bf8e2dd9 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | abfbc5579bd4507ae286d4f29f8a157de0629372 (diff) | |
download | llvm-ee073c798515e56b23463391a7b40d5ee6527337.zip llvm-ee073c798515e56b23463391a7b40d5ee6527337.tar.gz llvm-ee073c798515e56b23463391a7b40d5ee6527337.tar.bz2 |
[analyzer][StdLibraryFunctionsChecker] Fix typos in summaries of mmap and mmap64
The fd parameter of
```
void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
```
should be constrained to the range [0, IntMax] as that is of type int.
Constraining to the range [0, Off_tMax] would result in a crash as that is
of a signed type with the value of 0xff..f (-1).
The crash would happen when we try to apply the arg constraints.
At line 583: assert(Min <= Max), as 0 <= -1 is not satisfied
The mmap64 is fixed for the same reason.
Reviewed By: martong, vsavchenko
Differential Revision: https://reviews.llvm.org/D92307
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions