* [Ada] Fix potential access violation in Adjust routine
@ 2012-07-17 10:15 Arnaud Charlet
0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2012-07-17 10:15 UTC (permalink / raw)
To: gcc-patches; +Cc: Pascal Obry
[-- Attachment #1: Type: text/plain, Size: 155 bytes --]
Tested on x86_64-pc-linux-gnu, committed on trunk
2012-07-17 Pascal Obry <obry@adacore.com>
* s-regexp.adb (Adjust): Fix access violation in Adjust.
[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1323 bytes --]
Index: s-regexp.adb
===================================================================
--- s-regexp.adb (revision 189565)
+++ s-regexp.adb (working copy)
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2010, AdaCore --
+-- Copyright (C) 1999-2012, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -100,10 +100,12 @@
Tmp : Regexp_Access;
begin
- Tmp := new Regexp_Value (Alphabet_Size => R.R.Alphabet_Size,
- Num_States => R.R.Num_States);
- Tmp.all := R.R.all;
- R.R := Tmp;
+ if R.R /= null then
+ Tmp := new Regexp_Value (Alphabet_Size => R.R.Alphabet_Size,
+ Num_States => R.R.Num_States);
+ Tmp.all := R.R.all;
+ R.R := Tmp;
+ end if;
end Adjust;
-------------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-17 10:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 10:15 [Ada] Fix potential access violation in Adjust routine Arnaud Charlet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).