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 astOperatorNode semantics #1621

Merged
merged 8 commits into from Nov 6, 2023
Merged

Conversation

hainest
Copy link
Contributor

@hainest hainest commented Nov 5, 2023

The lack of consistent checking of empty pointers was fixed by #1609, but those changes broke the semantics of the class. This reverts those changes and fixes the pointer checks more directly.

@hainest hainest added bug dyninstAPI This issue is directly related to dyninstAPI labels Nov 5, 2023
@hainest hainest requested a review from kupsch November 5, 2023 21:13
@hainest hainest self-assigned this Nov 5, 2023
Copy link
Contributor

@kupsch kupsch left a comment

Choose a reason for hiding this comment

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

A couple of comments on changes in-line and 2 more since github won't allow commenting on lines not near a change:

Need add two more checks to ast.C lines 2460 & 2464 as both have unprotected loperand->print()'s.

@@ -1584,6 +1592,7 @@ bool AstOperatorNode::generateCode_phase2(codeGen &gen, bool noCost,
break;
}
case operandType::RegOffset: {
assert(loperand);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove as redundant. Can loperand be NULL here? Line 1303 requires it to be not NULL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it can't. I just missed it.

@@ -566,6 +572,7 @@ class AstOperatorNode : public AstNode {

bool generateOptimizedAssignment(codeGen &gen, int size, bool noCost);

AstOperatorNode() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

= default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's never used, so I removed it.

@hainest
Copy link
Contributor Author

hainest commented Nov 6, 2023

A couple of comments on changes in-line and 2 more since github won't allow commenting on lines not near a change:

Need add two more checks to ast.C lines 2460 & 2464 as both have unprotected loperand->print()'s.

I fixed them, but that whole definition can be removed. Its declaration was removed in 2006. I think everything guarded by ASTDEBUG can be removed, given how long that's been broken.

@hainest hainest merged commit cf4dc13 into master Nov 6, 2023
3 checks passed
@hainest hainest deleted the thaines/fix_AstOperatorNode_semantics branch November 6, 2023 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dyninstAPI This issue is directly related to dyninstAPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants