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: Fix undefined behavior in sample_motifs(sample = NULL) #1565

Closed
wants to merge 1 commit into from

Conversation

krlmlr
Copy link
Contributor

@krlmlr krlmlr commented Oct 30, 2024

Closes #1564.

Copy link
Contributor

aviator-app bot commented Oct 30, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was closed without merging. If you still want to merge this PR, re-open it.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@aviator-app aviator-app bot added the blocked label Oct 30, 2024
Copy link
Contributor

aviator-app bot commented Oct 30, 2024

This pull request failed to merge: some required checks failed. After you have resolved the problem, you should remove the blocked pull request label from this PR and then try to re-queue the PR. Note that the pull request will be automatically re-queued if it has the mergequeue label.

Failed checks: Sanitizer

@@ -229,7 +229,7 @@ sample_motifs <- function(graph, size = 3, cut.prob = rep(0, size),
on.exit(.Call(R_igraph_finalizer))
.Call(
R_igraph_motifs_randesu_estimate, graph, as.numeric(size),
as.numeric(cut.prob), as.numeric(sample.size), as.numeric(sample)
as.numeric(cut.prob), as.numeric(sample.size), sample
Copy link
Member

@szhorvat szhorvat Oct 31, 2024

Choose a reason for hiding this comment

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

Suggested change
as.numeric(cut.prob), as.numeric(sample.size), sample
as.numeric(cut.prob), as.numeric(sample.size), if (!is.null(sample) as_igraph_vs(graph, sample)-1 else NULL

I think the correct way to proceed is what I outline above. Can you change this before merging, @krlmlr ?

@szhorvat
Copy link
Member

Please use #1568 instead. I marked this as draft for safety, to make sure you see this message.

@szhorvat
Copy link
Member

Please use #1568 instead

#15698 was merged, so closing this one.

@szhorvat szhorvat closed this Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad conversion of NULL when passing integer vector
2 participants