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

dnfjson: fix pointer aliasing issue #391

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

diaasami
Copy link
Contributor

No description provided.

achilleas-k
achilleas-k previously approved these changes Jan 22, 2024
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

LGTM.

Pinging @ezr-ondrej on this since he wrote the original code to ask if this might disrupt anything. Afaict, the default value for the option should be false, so functionally this change should have no effect.

@diaasami diaasami marked this pull request as ready for review January 22, 2024 15:33
@achilleas-k
Copy link
Member

Also, for a bit more context for this, see: osbuild/osbuild-composer#3828 (comment)

@ezr-ondrej
Copy link
Contributor

I don't understand why there are no pointers in this struct in contrast to other structs around the repo, but I did like to have a pointer in this case, because I like the extra option "flag not passed" which might be different then setting to false explicitly. For depsolving only, it is only filosophical problem tho, as false is a default and when it's one use and doesn't stick around anywhere, it's the same thing.

If it would be passed to yum repo file on the image itself at some point I'd say it would make a slight difference tho.

For the record, I've originally proposed this as a nonpointer, to keep the struct non-pointer, but we've come to the current design in this conversation: #284 (comment)

I hope the context helps, I don't know enough to decide, I'll leave decisions to smarter people 😛

@achilleas-k
Copy link
Member

For the record, I've originally proposed this as a nonpointer, to keep the struct non-pointer, but we've come to the current design in this conversation: #284 (comment)

I hope the context helps, I don't know enough to decide

Thanks. That's basically the context I was looking for.
Given the conversation you linked and your description, I think we should keep it as a pointer and make sure it's copied explicitly without aliasing.

Copy link
Contributor

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

looks good to me 👍

Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

Thanks!

@achilleas-k achilleas-k added this pull request to the merge queue Jan 25, 2024
Merged via the queue into osbuild:main with commit 1c42864 Jan 25, 2024
10 checks passed
@diaasami diaasami deleted the aliasing_bug branch February 7, 2024 23:21
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