Skip to content

Commit cea0372

Browse files
committed
check that cppSourcePath exists before returning cache entry
1 parent dc17457 commit cea0372

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/Attributes.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ sourceCpp <- function(file = "",
201201
# return (invisibly) a list containing exported functions and modules
202202
invisible(list(functions = context$exportedFunctions,
203203
modules = context$modules,
204+
cppSourcePath = context$cppSourcePath,
204205
buildDirectory = context$buildDirectory))
205206
}
206207

@@ -1048,7 +1049,8 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
10481049
entry <- cache[[i]]
10491050
if ((nzchar(file) && identical(file, entry$file)) ||
10501051
(nzchar(code) && identical(code, entry$code))) {
1051-
return(i)
1052+
if (file.exists(entry$dynlib$cppSourcePath))
1053+
return(i)
10521054
}
10531055
}
10541056
}

0 commit comments

Comments
 (0)