From patchwork Thu Jan 31 01:29:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 1033873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-494997-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=charter.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="gICbMT01"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43qjN75T9lz9sDX for ; Thu, 31 Jan 2019 12:30:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=JnPQqVvxtkMyYc/l6RhmREfyUlxMC3BhnxadbSXzOmYau9Fx1e TlycnFsZ5ixEHD0Vr+BmZn3XBfx9EomUiD3nZ7pRoSam9E/OwKQfu2WPi0aqlnqT zLQum6m+C1mCBGcdnoR4AsEZ2cuuxcLAHQnEi57Xk4Xn1SeltuvvzARNc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=8yhfxo36jyu56uvLC7Z6mEYFdY8=; b=gICbMT01Er2l+QFBmJo1 OTpx+EI1AbXuwC/VKgCZXRbdVJXrGXMK9YZKAwSNP8KLOOErtOzxh0czmtBgBsjk alKmTcWp/rvNxy4kyHL2vqi+tawnb9u31oQHQQwJ1P1tRK5K6q6nRrKUP2J/DUIK uAULvrBvDD0AuBgasYQzA/U= Received: (qmail 60647 invoked by alias); 31 Jan 2019 01:30:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 60490 invoked by uid 89); 31 Jan 2019 01:30:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:ESMTPA X-HELO: impout008.msg.chrl.nc.charter.net Received: from impout008aa.msg.chrl.nc.charter.net (HELO impout008.msg.chrl.nc.charter.net) (47.43.20.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Jan 2019 01:29:59 +0000 Received: from [192.168.1.6] ([66.191.41.128]) by cmsmtp with ESMTPA id p1AvgCp9kYOHFp1Avgor28; Thu, 31 Jan 2019 01:29:56 +0000 Authentication-Results: charter.net; none From: Jerry DeLisle Subject: [patch, fortran] PR52564 Accepts invalid: Missing I/O list after comma To: "fortran@gcc.gnu.org" Cc: GCC Patches Message-ID: <12de47dd-d8c7-bef3-573b-814a34222417@charter.net> Date: Wed, 30 Jan 2019 17:29:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 The attached patch is straight-forward and self explanatory. Regression tested on x86-64-pc-linux-gnu. Test case attached. OK for trunk? 2019-01-31 Jerry DeLisle PR fortran/52564 * io.c (match_io): Add check for comma after '*' without subsequent IO list. diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index fce9228c302..95b30132203 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -4172,6 +4172,23 @@ match_io (io_kind k) else gfc_current_locus = where; } + + if (gfc_match_char ('*') == MATCH_YES + && gfc_match_char(',') == MATCH_YES) + { + locus where2 = gfc_current_locus; + if (gfc_match_eos () == MATCH_YES) + { + gfc_current_locus = where2; + gfc_error ("Comma after * at %C not allowed without I/O list"); + m = MATCH_ERROR; + goto cleanup; + } + else + gfc_current_locus = where; + } + else + gfc_current_locus = where; } if (gfc_current_form == FORM_FREE)