Static analyzer reports dyn_cast at line 970 could return nullptr which could lead to security issue when deref it at line 971.
I think author could confirm the ptr Code could always be StringInit type here so I add assert to avoid static analyzer report.
Details
Details
- Reviewers
Pierre-vh
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Time | Test | |
---|---|---|
60,050 ms | x64 debian > MLIR.Examples/standalone::test.toy |
Event Timeline
Comment Actions
Thanks for the fix! It's good to commit as-is if you want a quick fix, but the version I propose is the best possible user experience.
Note it's all going away in D156315 anyway.
llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp | ||
---|---|---|
970–973 | Ideally do this, otherwise just change the dyn_cast to a cast and it'll just assert if it's the wrong type. |
Comment Actions
OK, Thanks for explanation. Since it will be a big change in D156315 and this issue could disappear, I would abandon this unnecessary revision.
Ideally do this, otherwise just change the dyn_cast to a cast and it'll just assert if it's the wrong type.