From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e0fa6eae2c537e3d,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 22 Mar 2011 13:35:19 -0500 Newsgroups: comp.lang.ada Date: Tue, 22 Mar 2011 14:35:15 -0400 From: "Peter C. Chapin" Subject: GNAT.Regpat problem. Message-ID: User-Agent: Alpine 2.00 (WNT 1167 2008-08-23) X-X-Sender: pcc09070@vtc.vsc.edu@webmail.vtc.edu MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-aOWpIdr5xfK8Ek5DgcT2+5s3ufC+k20xz4D4qP3oScViT4biLyROM0kTlBVUFEYj5lSxYbwyzbLgFvM!vNud/SdUIAuWM2JKYKeCpLWvg12ocOoTmSHuXImpsSWGzJSesOR3t93NV4AnkuizvSxbeicHEg== X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2085 Xref: g2news1.google.com comp.lang.ada:18378 Date: 2011-03-22T14:35:15-04:00 List-Id: I'm trying to use regular expressions in a program via the package GNAT.Regpat. Here is a reduced example: with Ada.Text_IO; use Ada.Text_IO; with GNAT.Regpat; procedure Check is Matcher : GNAT.Regpat.Pattern_Matcher(10); begin GNAT.Regpat.Compile(Matcher, "^[:space:]*xyzzy$"); exception when Storage_Error => Put_Line("Insufficient space in Pattern_Matcher"); end Check; The documentation for package GNAT.Regpat says this about the Compile procedure I think I'm using: "This function [sic] raises Storage_Error if Matcher is too small to hold the resulting code (i.e. Matcher.Size has too small a value)." In the example above the size is intentionally set too small. My program fails with a PROGRAM_ERROR exception (EXCEPTION_ACCESS_VIOLATION). If I make the size of the Matcher just 1, the program hangs. If I make the size something reasonable, the program runs fine. So is this an issue with GNAT.Regpat? It seems like it does not honor its documentation. Perhaps I'm doing something wrong. Peter