-
Notifications
You must be signed in to change notification settings - Fork 998
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 fcase() segfault (#6452) #6451
Fix fcase() segfault (#6452) #6451
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @MichaelChirico and the rest of your teammates on |
84e0932
to
49bc983
Compare
Generated via commit 49bc983 Download link for the artifact containing the test results: ↓ atime-results.zip Time taken to finish the standard R installation steps: 11 minutes and 37 seconds Time taken to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this change separates the variables of the same names above so as to not be confused with the the test, yes, and no arguments!
@@ -209,12 +209,12 @@ SEXP fcaseR(SEXP rho, SEXP args) { | |||
"Note that the default argument must be named explicitly, e.g., default=0"), narg - 2); | |||
} | |||
int nprotect=0, l; | |||
int64_t len0=0, len1=0, len2=0; | |||
int64_t n_ans=0, n_this_arg=0, n_undecided=0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n_undecided
sounds good to indicate the count of the unresolved elements/cases. An alternative I can think of is n_pending
(as in tracking how many elements are left to be evaluated)
Is n_this_arg
meant to represent the length of the thens
argument that is being processed in the current iteration? (I only see it being assigned to it at 285 below, so I'm wondering if it could be renamed specific to it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Yes you're right about n_this_arg
. I'm roughly indifferent between n_undecided
and n_pending
; both are way better than len2
:)
this is great thanks for refactoring variable names |
Made the mistake of merging #6452 into this branch instead of I'll just merge this branch to master, rename the PR & merge here as if nothing happened :) |
…fcase_counting_variables
No description provided.