Looking here:
|
if (Rf_isString(from)) { |
|
if (Rf_xlength(from) == 1) { |
|
const char* c_p = nullptr; |
|
unwind_protect([&] { c_p = Rf_translateCharUTF8(STRING_ELT(from, 0)); }); |
|
return c_p[0]; |
|
} |
|
} |
If an error occurs during translation, c_p will remain as a nullptr and then the attempt to access the zero-th element will likely crash.
Looking here:
cpp11/inst/include/cpp11/as.hpp
Lines 109 to 115 in cf7391b
If an error occurs during translation,
c_pwill remain as anullptrand then the attempt to access the zero-th element will likely crash.