From 7f6be6c900ef58f7876d892ec335ec83e8e0ea70 Mon Sep 17 00:00:00 2001 From: ripley Date: Fri, 21 Feb 2025 10:37:08 +0000 Subject: [PATCH] use asRbool to catch misuse, e.g. in min(na.rm =) git-svn-id: https://svn.r-project.org/R/trunk@87777 00db46b3-68df-0310-9c12-caf00c1e9a41 --- src/main/summary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/summary.c b/src/main/summary.c index 804c4152d47..7cb5e59a3e1 100644 --- a/src/main/summary.c +++ b/src/main/summary.c @@ -1,6 +1,6 @@ /* * R : A Computer Language for Statistical Data Analysis - * Copyright (C) 1997--2023 The R Core Team + * Copyright (C) 1997--2025 The R Core Team * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * * This program is free software; you can redistribute it and/or modify @@ -579,7 +579,7 @@ attribute_hidden SEXP do_summary(SEXP call, SEXP op, SEXP args, SEXP env) #endif ans = matchArgExact(R_NaRmSymbol, &args); - Rboolean narm = asLogical(ans); + Rboolean narm = asRbool(ans, call); if (ALTREP(CAR(args)) && CDDR(args) == R_NilValue && (CDR(args) == R_NilValue || TAG(CDR(args)) == R_NaRmSymbol)) {