Skip to content

A few questions about programming Clang Static Analyzer checkers. #120961

@LuMingYinDetect

Description

@LuMingYinDetect

Dear LLVM Project Developers,

I apologize for the interruption. Recently, I encountered some issues during the process of writing Clang Static Analyzer checkers that I have been unable to resolve. Specifically, the test code is as follows:
int custom_malloc(int **ptr, size_t size,struct Person *person) { *ptr = (int *)malloc(size); if (*ptr == NULL) { printf("Error: Memory allocation failed.\n"); } return 1; }
In the checker, I matched the return statement using the checkEndFunction callback. I want to retrieve the SymbolRef and corresponding MemRegion for the function parameter ptr when the program reaches the return statement (in the test code, ptr points to a new memory region). However, I'm not sure which interface to use to obtain the assignment status of the function's parameters within the function at this point.I look forward to your reply!

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:static analyzerquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions