[libcxx-commits] [compiler-rt] [libcxx] [mlir] [llvm] [clang] [asan] Enable StackSafetyAnalysis by default (PR #77210)

Fangrui Song via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 11 12:38:58 PST 2024


MaskRay wrote:

> Reverted at [e7f7948](https://github.com/llvm/llvm-project/commit/e7f794875169811f3801fad6d40bb9fe833e1a69). Will file an issue to track it once reducing is done.

I've reduced it. It's code like below where a  memcpy confused StackSafetyAnalysis in a  macOS+libc++ build.

```cpp
int floatsuffix_check(TParseContext *context)
{
    struct yyguts_t *yyg = (struct yyguts_t *)context->getScanner();

    if (context->getShaderVersion() < 300)
    {
        context->error(*yyg->yylloc_r, "Floating-point suffix unsupported prior to GLSL ES 3.00", yyg->yytext_r);
        return 0;
    }

    std::string text = yyg->yytext_r;
    text.resize(text.size() - 1);    ///////// 
    if (!strtof_clamp(text, &(yyg->yylval_r->lex.f)))
        yyg->yyextra_r->warning(*yyg->yylloc_r, "Float overflow", yyg->yytext_r);

    return (FLOATCONSTANT);
}
```

https://github.com/llvm/llvm-project/pull/77210


More information about the libcxx-commits mailing list