Skip to content

Conversation

@ludviggunne
Copy link
Collaborator

No description provided.

@danmar
Copy link
Owner

danmar commented Dec 3, 2024

Please mention in the PR title if it's a False Negative or False Positive. It will make the git log more clear..

@danmar
Copy link
Owner

danmar commented Dec 3, 2024

Spontanously there seems to be a problem with the AST. That should be fixed first. When I run these commands:

daniel@laptop:~/cppchecksolutions/cppcheck$ cat 13367.cpp 
typedef struct pathNode_s {
    struct pathNode_s*  next;
} pathNode_t;\n"

void f() {
    x<pathNode_t, offsetof( pathNode_t, next )> y;
}
daniel@laptop:~/cppchecksolutions/cppcheck$ ./cppcheck --dump 13367.cpp 

in the dump output I get; the "offsetof" does not have a astParent(), can you reproduce that also?

@ludviggunne
Copy link
Collaborator Author

in the dump output I get; the "offsetof" does not have a astParent(), can you reproduce that also?

Yep, I saw that too. I figured since the match pattern was so specific this would be sufficient. So the template arguments not haveing astParent etc. is a bug? I wasn't sure since template arguments seem to be treated differently in general.

@ludviggunne ludviggunne changed the title Fix #13367: nullptr dereference in checkStructMemberUsage() Fix #13367: (crash) nullptr dereference in checkStructMemberUsage() Dec 3, 2024
@danmar
Copy link
Owner

danmar commented Dec 3, 2024

ok I allow it I am not sure if it's a bug.

@danmar danmar merged commit c2adbe3 into danmar:main Dec 3, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants