| commit | a6d401703b7542e00c85767513be0851df6c67cf | [log] [tgz] |
|---|---|---|
| author | Fangrui Song <i@maskray.me> | Thu Jan 11 13:54:07 2024 -0800 |
| committer | GitHub <noreply@github.com> | Thu Jan 11 13:54:07 2024 -0800 |
| tree | f918e1d8a071408b0610eccf9de436e617fe9d00 | |
| parent | 238b5790ba2027a88706a320fe61bd21601b788b [diff] |
[StackSafetyAnalysis] Bail out if MemIntrinsic length is -1 (#77837) Clang generates llvm.memset.p0.i64 with a length of -1 for the following code in `-stdlib=libc++ -std=c++20` mode (https://github.com/llvm/llvm-project/pull/77210#issuecomment-1887650010) ```cpp bool strtof_clamp(const std::string &str); void floatsuffix_check(char *yytext_r) { std::string text = yytext_r; text.resize(text.size() - 1); strtof_clamp(text); } ``` `Sizes = [0xffffffffffffffff, 0)`. `SizeRange = [0, 0-1)`, leading to `assert(!isUnsafe(SizeRange));` failure. Bail out if the length is -1. Other negative values are handled by the existing condition.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.