From patchwork Fri Nov 13 13:15:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 544277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 743A614142D for ; Sat, 14 Nov 2015 00:15:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=j7p209wn; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=Nrj3Bo9C2wdIcZOTtV818x33tnZWqOO6KZRlR3UBhAE1L+9h28 fk7T0CGaO63lwW3MqzoJAwWdYj/RYHRp97ujsEkRjFQpGToTooxTa43VZ3Zz8on7 bkOgyEVPeYAY0yqGzkq5Et9DmTbENUmOCS/rIDkBbOZTjlzQTrlxa/rhI= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=JKdnSHpLATNaMcQBRu21QnLjQ10=; b=j7p209wnWweegfM19nPd L56zY4kFaFRI/K765wv55JgOAcf+GAn/T+KACuXK5Vj8i4fclS3kVHRmo2EUvi26 Wwyiyxvikp2irNIS1YGB9IdKHbJnjznW/0qVQulS+NoSxJQa2jv1cB3i67ndzXru 7of/upQ8lRRG7o+Le46V7Lg= Received: (qmail 127191 invoked by alias); 13 Nov 2015 13:15:31 -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 125739 invoked by uid 89); 13 Nov 2015 13:15:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.9 required=5.0 tests=BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 13 Nov 2015 13:15:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B9E322957E; Fri, 13 Nov 2015 08:15:04 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SKjrTEPFqQ+i; Fri, 13 Nov 2015 08:15:04 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id AA1002944B; Fri, 13 Nov 2015 08:15:04 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4192) id A94171A0; Fri, 13 Nov 2015 08:15:04 -0500 (EST) Date: Fri, 13 Nov 2015 08:15:04 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Hristian Kirtchev Subject: [Ada] Internal crash on illegal aspect Part_Of Message-ID: <20151113131504.GA20207@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This patch modifies the analysis of aspect specifications to continue the analysis after encountering an illegal aspect Part_Of. ------------ -- Source -- ------------ -- po_t.ads package PO_T is protected Prot_Typ is function Get return Integer; entry Set (X : Integer); private Condition : Boolean := True with Part_Of => Prot_Typ; end Prot_Typ; end PO_T; -- po_t.adb package body PO_T is protected body Prot_Typ is function Get return Integer is begin return 0; end Get; entry Set (X : Integer) when Condition is begin null; end Set; end Prot_Typ; end PO_T; ---------------------------- -- Compilation and Output -- ---------------------------- $ gcc -c po_t.adb po_t.ads:8:14: aspect "Part_Of" must apply to package instantiation, object, single protected type or single task type Tested on x86_64-pc-linux-gnu, committed on trunk 2015-11-13 Hristian Kirtchev * sem_ch13.adb (Analyze_Aspect_Specifications): Continue the analysis after encountering an illegal aspect Part_Of. Index: sem_ch13.adb =================================================================== --- sem_ch13.adb (revision 230301) +++ sem_ch13.adb (working copy) @@ -2673,7 +2673,6 @@ Decorate (Aspect, Aitem); Insert_Pragma (Aitem); - goto Continue; else Error_Msg_NE @@ -2682,6 +2681,8 @@ Aspect, Id); end if; + goto Continue; + -- SPARK_Mode when Aspect_SPARK_Mode =>