Skip to content

Commit cf0f051

Browse files
author
luke
committed
Avoid infinite recursion in all.equal (PR18966).
git-svn-id: https://svn.r-project.org/R/trunk@89018 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 0f7760a commit cf0f051

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/library/base/R/all.equal.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ all.equal.default <- function(target, current, ..., check.class = TRUE)
8080
all.equal.function <- function(target, current, check.environment = TRUE, ...)
8181
{
8282
msg <- all.equal.language(target, current, ...)
83-
if(check.environment) {
83+
if (is.null(current))
84+
## need to handle separately since environment(NULL) is the
85+
## current evaluation environment
86+
msg
87+
else if(check.environment) {
8488
## pre-check w/ identical(), for speed & against infinite recursion:
8589
ee <- identical(environment(target),
8690
environment(current), ignore.environment=FALSE)

0 commit comments

Comments
 (0)