mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 12:16:07 +00:00
[llvm-profgen] CSProfileGenerator::generateLineNumBasedProfile - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced immediately below, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
0af1808f9b
commit
86bbf01d89
@ -614,8 +614,8 @@ void CSProfileGenerator::computeSizeForProfiledFunctions() {
|
||||
|
||||
void CSProfileGenerator::generateLineNumBasedProfile() {
|
||||
for (const auto &CI : SampleCounters) {
|
||||
const StringBasedCtxKey *CtxKey =
|
||||
dyn_cast<StringBasedCtxKey>(CI.first.getPtr());
|
||||
const auto *CtxKey = cast<StringBasedCtxKey>(CI.first.getPtr());
|
||||
|
||||
// Get or create function profile for the range
|
||||
FunctionSamples &FunctionProfile =
|
||||
getFunctionProfileForContext(CtxKey->Context, CtxKey->WasLeafInlined);
|
||||
|
Loading…
x
Reference in New Issue
Block a user