This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Fix null pointer dereferences in TreePattern::ParseTreePattern()
ClosedPublic

Authored by SweetVishnya on Apr 6 2023, 6:54 AM.

Details

Summary

Bugs were found by Svace static analysis tool. Null pointers are
dereferenced right after error checking that does not return from
function.

Diff Detail

Event Timeline

SweetVishnya created this revision.Apr 6 2023, 6:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 6:54 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
SweetVishnya requested review of this revision.Apr 6 2023, 6:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 6:54 AM
arsenm accepted this revision.Apr 7 2023, 4:07 PM

LGTM. Tests would be nice

This revision is now accepted and ready to land.Apr 7 2023, 4:07 PM

LGTM. Tests would be nice

These bugs were found by a static analyzer based on the fact that null pointer is checked right before dereference. I don't really know how to hand-craft test cases for these errors.

Can we merge this fix into main branch?

arsenm added a comment.May 9 2023, 3:15 PM

Can we merge this fix into main branch?

Don’t see why not

arsenm added a comment.May 9 2023, 3:18 PM

Can we merge this fix into main branch?

Don’t see why not

Have you opened an issue to merge it?

Can we merge this fix into main branch?

Don’t see why not

Have you opened an issue to merge it?

No, I haven't. I thought that patches are merged some time after approval. What further actions should I take?

Can we merge this fix into main branch?

Don’t see why not

Have you opened an issue to merge it?

No, I haven't. I thought that patches are merged some time after approval. What further actions should I take?

Patches are usually merged by person submitting the patch. If you don't have commit access say so and one of the reviewers can commit it for you. Please provide your name and email as it should appear in the git commit log.

Can we merge this fix into main branch?

Don’t see why not

Have you opened an issue to merge it?

No, I haven't. I thought that patches are merged some time after approval. What further actions should I take?

Patches are usually merged by person submitting the patch. If you don't have commit access say so and one of the reviewers can commit it for you. Please provide your name and email as it should appear in the git commit log.

Yes, I don't have a commit access. Can you commit the patch for me, please? My name is "Alexey Vishnyakov" and email is "vishnya@ispras.ru"