Skip to content

Commit

Permalink
Merge pull request #210 from zombodb/reduce-ub
Browse files Browse the repository at this point in the history
chore: reduce UB in public API
  • Loading branch information
Hoverbear authored Sep 23, 2021
2 parents 235e8ff + bf97110 commit 4e21895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgx/src/itemptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ pub fn u64_to_item_pointer_parts(value: u64) -> (pg_sys::BlockNumber, pg_sys::Of

#[allow(clippy::not_unsafe_ptr_arg_deref)] // this is okay b/c we guard against ctid being null
#[inline]
pub fn item_pointer_is_valid(ctid: *const pg_sys::ItemPointerData) -> bool {
pub unsafe fn item_pointer_is_valid(ctid: *const pg_sys::ItemPointerData) -> bool {
if ctid.is_null() {
false
} else {
unsafe { *ctid }.ip_posid != pg_sys::InvalidOffsetNumber
(*ctid).ip_posid != pg_sys::InvalidOffsetNumber
}
}

Expand Down

0 comments on commit 4e21895

Please sign in to comment.