Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix seg fault for catch(...) #718

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Conversation

vaithak
Copy link
Collaborator

@vaithak vaithak commented Jan 18, 2024

fixes #86

@vaithak vaithak self-assigned this Jan 18, 2024
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d8ef790) 94.54% compared to head (c4e3bcf) 94.60%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #718      +/-   ##
==========================================
+ Coverage   94.54%   94.60%   +0.05%     
==========================================
  Files          49       49              
  Lines        7189     7189              
==========================================
+ Hits         6797     6801       +4     
+ Misses        392      388       -4     
Files Coverage Δ
lib/Differentiator/StmtClone.cpp 57.61% <100.00%> (+1.64%) ⬆️
Files Coverage Δ
lib/Differentiator/StmtClone.cpp 57.61% <100.00%> (+1.64%) ⬆️

Comment on lines 429 to 431
DEFINE_CLONE_STMT(CXXCatchStmt, (Node->getCatchLoc(),
static_cast<VarDecl*>(
CloneDeclOrNull(Node->getExceptionDecl())),
Clone(Node->getHandlerBlock())))
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
DEFINE_CLONE_STMT(CXXCatchStmt, (Node->getCatchLoc(),
static_cast<VarDecl*>(
CloneDeclOrNull(Node->getExceptionDecl())),
Clone(Node->getHandlerBlock())))
DEFINE_CLONE_STMT(CXXCatchStmt, (Node->getCatchLoc(), CloneDeclOrNull(Node->getExceptionDecl()), Clone(Node->getHandlerBlock())))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed the statiic_cast and ran clang-format again 👍🏼

Copy link
Owner

Choose a reason for hiding this comment

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

Either way the formatting looks ugly... let's move forward.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev merged commit d5a8ac9 into vgvassilev:master Jan 18, 2024
81 checks passed
@vaithak vaithak deleted the catch-fix branch March 13, 2024 13:20
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.

Cloning try-block with catch(...) causes SegFault in StmtClone::CloneDecl
2 participants