Skip to content

misra.py: Fix R12.4 and R13.1 crashes on large initializer lists#2410

Merged
danmar merged 1 commit into
cppcheck-opensource:masterfrom
jubnzv:fix-12-4-13-1-recursion-depth
Dec 1, 2019
Merged

misra.py: Fix R12.4 and R13.1 crashes on large initializer lists#2410
danmar merged 1 commit into
cppcheck-opensource:masterfrom
jubnzv:fix-12-4-13-1-recursion-depth

Conversation

@jubnzv

@jubnzv jubnzv commented Nov 30, 2019

Copy link
Copy Markdown
Contributor

Fixed usage of hasSideEffectsRecursive which was causes crashes of rules 12.4 and 13.1.

These changes don't solve problem with recursive functions completely, but at least I can't found any real cases which will crash misra.py on recursive calls. Scanning dump files described in trac ticket don't cause crash anymore.

See trac ticket: https://trac.cppcheck.net/ticket/9487

Fixed usage of hasSideEffectsRecursive which was causes crashes
of rules 12.4 and 13.1.

Add more tests for these rules.

See trac ticket: https://trac.cppcheck.net/ticket/9487

@versat versat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These huge arrays in the test file do not look nice. But I admit that I have no better idea and not adding the tests is IMO also not a solution.
Maybe it is useful to create an extra test file for such crash tests, but that has to be discussed. Maybe it is the best for now to leave it as it is in this PR.

@danmar

danmar commented Dec 1, 2019

Copy link
Copy Markdown
Collaborator

Maybe it is useful to create an extra test file for such crash tests, but that has to be discussed. Maybe it is the best for now to leave it as it is in this PR.

Yes I agree. If we get lots of stability tests it might be better to separate them and put them in separate files.

@danmar danmar merged commit 6bacc19 into cppcheck-opensource:master Dec 1, 2019
@danmar

danmar commented Dec 1, 2019

Copy link
Copy Markdown
Collaborator

for now I allow that this testing is added in the "master misra test file".

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.

3 participants