search for: r_chk_memcpi

Displaying 2 results from an estimated 2 matches for "r_chk_memcpi".

Did you mean: r_chk_memcpy
2025 Apr 23
1
R should add an API routine for safe use of memcpy(), memset() for use with 0-length SEXP
On 4/24/25 00:18, Michael Chirico wrote: > In that case it seems like just erroring instead of returning invalid > pointers is a much friendlier option. Why give developers an unpinned > grenade to carry around? That would be too strict at this point. There is too much code around depending on that holding on to an invalid pointer (but not dereferencing it) is ok, and it is currently
2025 Apr 23
1
R should add an API routine for safe use of memcpy(), memset() for use with 0-length SEXP
>From R 4.5.0 [1], all builds of R discourage use of INTEGER() [and friends REAL(), ... and *_RO() equivalents] on length-0 SEXP [2]. Before R 4.5.0, this was the behavior under --enable-strict-barrier. That means the following can segfault under strict builds (e.g. -fsanitize=alignment and -O0): SEXP x = PROTECT(Rf_allocVector(INTSXP, 0)); SEXP y = PROTECT(Rf_allocVector(INTSXP, 0)); const