From martin.morgan at roswellpark.org  Fri Jul 21 09:43:48 2017
From: martin.morgan at roswellpark.org (Martin Morgan)
Date: Fri, 21 Jul 2017 03:43:48 -0400
Subject: [Rd] [PATCH] Fix missing break
In-Reply-To: <60035856.27PnXlZqtm@x2>
References: <60035856.27PnXlZqtm@x2>
Message-ID: <cadf2c7b-e6d7-e8ba-20e6-17f53a0a6197@roswellpark.org>

On 07/20/2017 05:02 PM, Steve Grubb wrote:
> Hello,
> 
> There appears to be a break missing in the switch/case for the LISTSXP case.
> If this is supposed to fall through, I'd suggest a comment so that others
> know its by design.
> 
> Signed-off-by: Steve Grubb <sgrubb at redhat.com>

An example is

$ R --vanilla -e "pl = pairlist(1, 2); length(pl) = 1; pl"
 > pl = pairlist(1, 2); length(pl) = 1; pl
Error in length(pl) = 1 :
   SET_VECTOR_ELT() can only be applied to a 'list', not a 'pairlist'
Execution halted

fixed in r72936 (R-devel) / 72937 (R-3-4-branch).

Martin Morgan

> 
> Index: src/main/builtin.c
> ===================================================================
> --- src/main/builtin.c	(revision 72935)
> +++ src/main/builtin.c	(working copy)
> @@ -888,6 +888,7 @@
>   	    SETCAR(t, CAR(x));
>   	    SET_TAG(t, TAG(x));
>   	}
> +	break;
>       case VECSXP:
>   	for (i = 0; i < len; i++)
>   	    if (i < lenx) {
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 


This email message may contain legally privileged and/or...{{dropped:2}}



[Rd] [PATCH] Fix missing break
Martin Morgan