You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are indeed returning a pointer to the data for a std::string on the stack, which is unsafe. Note that while this is a registered routine, it's only used internally (when Rcpp debugging is enabled via RCPP_DEBUG). Either way, two potential fixes here would be:
Just return a std::string rather than a const char*, or
Use a static std::string, and return a pointer to the data for that std::string.
The text was updated successfully, but these errors were encountered:
Saw this while compiling Rcpp with the latest version of LLVM on macOS:
The offending routine is here:
Rcpp/src/api.cpp
Lines 129 to 137 in c9cf6aa
We are indeed returning a pointer to the data for a
std::string
on the stack, which is unsafe. Note that while this is a registered routine, it's only used internally (when Rcpp debugging is enabled viaRCPP_DEBUG
). Either way, two potential fixes here would be:std::string
rather than aconst char*
, orstd::string
, and return a pointer to the data for thatstd::string
.The text was updated successfully, but these errors were encountered: