[multiple changes]

2014-02-20  Robert Dewar  <dewar@adacore.com>

	* sem_elab.adb: Minor code reorganization (use Nkind_In).
	* stringt.adb: Remove temporary pragma Warnings (Off).
	* stringt.ads: Add pragma Elaborate_Body to ensure initialization
	of Null_String_Id.

2014-02-20  Matthew Heaney  <heaney@adacore.com>

	* a-chtgbk.adb (Replace): Use correct offset when calculating bucket
	index.

From-SVN: r207944
This commit is contained in:
Arnaud Charlet 2014-02-20 14:44:20 +01:00
parent 0c7e0c3254
commit 3730c4a046
5 changed files with 25 additions and 8 deletions

View File

@ -1,3 +1,15 @@
2014-02-20 Robert Dewar <dewar@adacore.com>
* sem_elab.adb: Minor code reorganization (use Nkind_In).
* stringt.adb: Remove temporary pragma Warnings (Off).
* stringt.ads: Add pragma Elaborate_Body to ensure initialization
of Null_String_Id.
2014-02-20 Matthew Heaney <heaney@adacore.com>
* a-chtgbk.adb (Replace): Use correct offset when calculating bucket
index.
2014-02-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): Initialize

View File

@ -275,6 +275,13 @@ package body Ada.Containers.Hash_Tables.Generic_Bounded_Keys is
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
-- The following block appears to be vestigial -- this should be done
-- using Checked_Index instead. Also, we might have to move the actual
-- tampering checks to the top of the subprogram, in order to prevent
-- infinite recursion when calling Hash. (This is similar to how Insert
-- and Delete are implemented.) This implies that we will have to defer
-- the computation of New_Index until after the tampering check. ???
declare
B : Natural renames HT.Busy;
L : Natural renames HT.Lock;
@ -282,7 +289,7 @@ package body Ada.Containers.Hash_Tables.Generic_Bounded_Keys is
B := B + 1;
L := L + 1;
Old_Indx := Hash (NN (Node)) mod HT.Buckets'Length;
Old_Indx := HT.Buckets'First + Hash (NN (Node)) mod HT.Buckets'Length;
B := B - 1;
L := L - 1;

View File

@ -1553,11 +1553,9 @@ package body Sem_Elab is
-- then there is nothing to do (we do not know what is being assigned),
-- but otherwise this is an assignment to the prefix.
if Nkind (N) = N_Indexed_Component
or else
Nkind (N) = N_Selected_Component
or else
Nkind (N) = N_Slice
if Nkind_In (N, N_Indexed_Component,
N_Selected_Component,
N_Slice)
then
if not Is_Access_Type (Etype (Prefix (N))) then
Check_Elab_Assign (Prefix (N));

View File

@ -474,8 +474,6 @@ package body Stringt is
-- Setup the null string
pragma Warnings (Off); -- kill strange warning from code below ???
begin
Start_String;
Null_String_Id := End_String;

View File

@ -33,6 +33,8 @@ with System; use System;
with Types; use Types;
package Stringt is
pragma Elaborate_Body;
-- This is to make sure Null_String_Id is properly initialized
-- This package contains routines for handling the strings table which is
-- used to store string constants encountered in the source, and also those