Open richfitz opened 2 years ago
odin::odin({ X[] <- user(1) dim(X) <- 5 initial(a) <- 0 deriv(a) <- sum(X) }, workdir = "err")
then look in err/src/odin.c
err/src/odin.c
SEXP odin_create(SEXP user) { odin_internal *internal = (odin_internal*) R_Calloc(1, odin_internal); internal->X = NULL; internal->dim_X = 5; internal->initial_a = 0; internal->X = 1; SEXP ptr = PROTECT(R_MakeExternalPtr(internal, R_NilValue, R_NilValue)); R_RegisterCFinalizer(ptr, odin_finalise); UNPROTECT(1); return ptr; }
which creates a really bad pointer for X (and later on a crash). We should either support this properly, or error
Reported by @lwhittles
then look in
err/src/odin.c
which creates a really bad pointer for X (and later on a crash). We should either support this properly, or error
Reported by @lwhittles