Skip to content

Comments

Fix UB for non-integer RTYPEs in comparator#1453

Merged
Enchufa2 merged 1 commit intomasterfrom
fix/1452
Feb 17, 2026
Merged

Fix UB for non-integer RTYPEs in comparator#1453
Enchufa2 merged 1 commit intomasterfrom
fix/1452

Conversation

@Enchufa2
Copy link
Member

Closes #1452.

Checklist

  • Code compiles correctly
  • R CMD check still passes all tests
  • Preferably, new tests were added which fail without the change
  • Document the changes by file in ChangeLog

inline int rhs_is_not_na(int i) const {
STORAGE x = lhs[i] ;
return Rcpp::traits::is_na<RTYPE>(x) ? x : op( x, rhs ) ;
return Rcpp::traits::is_na<RTYPE>(x) ? NA_INTEGER : op( x, rhs ) ;
Copy link
Member

Choose a reason for hiding this comment

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

🧑‍🍳 💋 <- no "chef's kiss" emoji here so improvising

Copy link
Contributor

@kevinushey kevinushey left a comment

Choose a reason for hiding this comment

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

LGTM; nice getting that fixed up in record time!

@Enchufa2 Enchufa2 merged commit cb32c5c into master Feb 17, 2026
26 checks passed
@Enchufa2 Enchufa2 deleted the fix/1452 branch February 17, 2026 16:14
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.

Undefined behavior in Comparator_With_One_Value

3 participants