We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9642541 commit 463d4e9Copy full SHA for 463d4e9
inst/include/Rcpp/api/meat/is.h
@@ -150,10 +150,13 @@ namespace Rcpp {
150
151
inline bool is_module_object_internal(SEXP obj, const char* clazz){
152
Environment env(obj);
153
- XPtr<class_Base> xp( env.get(".cppclass"));
+ SEXP sexp = env.get(".cppclass");
154
+ if (TYPEOF(sexp) != EXTPTRSXP) return false;
155
+ XPtr<class_Base> xp(sexp);
156
return xp->has_typeinfo_name(clazz);
157
}
158
template <typename T> bool is__module__object(SEXP x) {
159
+ if (!is__simple<S4>(x)) return false;
160
typedef typename Rcpp::traits::un_pointer<T>::type CLASS;
161
return is_module_object_internal(x, typeid(CLASS).name());
162
0 commit comments