Commit 01cd0938 by Arnaud Charlet

[multiple changes]

2009-04-17  Robert Dewar  <dewar@adacore.com>

	* exp_ch5.adb (Expand_Assign_Array): Do not set Forwards_OK and
	Backwards_OK if either operand has an address clause.

2009-04-17  Pascal Obry  <obry@adacore.com>

	* initialize.c: Code clean up, use realloc.

From-SVN: r146259
parent 46e26fe3
2009-04-17 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb (Expand_Assign_Array): Do not set Forwards_OK and
Backwards_OK if either operand has an address clause.
2009-04-17 Pascal Obry <obry@adacore.com>
* initialize.c: Code clean up, use realloc.
2009-04-17 Pascal Obry <obry@adacore.com> 2009-04-17 Pascal Obry <obry@adacore.com>
* initialize.c: Do not get Unicode command line if Unicode support not * initialize.c: Do not get Unicode command line if Unicode support not
...@@ -308,6 +308,19 @@ package body Exp_Ch5 is ...@@ -308,6 +308,19 @@ package body Exp_Ch5 is
-- can be performed directly. -- can be performed directly.
end if; end if;
-- If either operand has an address clause clear Backwards_OK and
-- Forwards_OK, since we cannot tell if the operands overlap.
if (Is_Entity_Name (Lhs)
and then Present (Address_Clause (Entity (Lhs))))
or else
(Is_Entity_Name (Lhs)
and then Present (Address_Clause (Entity (Lhs))))
then
Set_Forwards_OK (N, False);
Set_Backwards_OK (N, False);
end if;
-- We certainly must use a loop for change of representation and also -- We certainly must use a loop for change of representation and also
-- we use the operand of the conversion on the right hand side as the -- we use the operand of the conversion on the right hand side as the
-- effective right hand side (the component types must match in this -- effective right hand side (the component types must match in this
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "tsystem.h" #include "tsystem.h"
/* We don't have libiberty, so use malloc. */ /* We don't have libiberty, so use malloc. */
#define xmalloc(S) malloc (S) #define xmalloc(S) malloc (S)
#define xrealloc(V,S) realloc (V,S)
#else #else
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
...@@ -83,17 +84,8 @@ append_arg (int *index, LPWSTR value, char ***argv, int *last) ...@@ -83,17 +84,8 @@ append_arg (int *index, LPWSTR value, char ***argv, int *last)
if (*last < *index) if (*last < *index)
{ {
char **old_argv = *argv;
int old_last = *last;
int k;
*last += EXPAND_ARGV_RATE; *last += EXPAND_ARGV_RATE;
*argv = (char **) xmalloc ((*last) * sizeof (char *)); *argv = (char **) xrealloc (*argv, (*last) * sizeof (char *));
for (k=0; k<=old_last; k++)
(*argv)[k] = old_argv[k];
free (old_argv);
} }
size = WS2SC (NULL, value, 0); size = WS2SC (NULL, value, 0);
...@@ -102,20 +94,6 @@ append_arg (int *index, LPWSTR value, char ***argv, int *last) ...@@ -102,20 +94,6 @@ append_arg (int *index, LPWSTR value, char ***argv, int *last)
(*index)++; (*index)++;
} }
static void
adjust_arg (int last, char ***argv)
{
char **old_argv = *argv;
int k;
*argv = (char **) xmalloc (last * sizeof (char *));
for (k=0; k<last; k++)
(*argv)[k] = old_argv[k];
free (old_argv);
}
#endif #endif
void void
...@@ -200,7 +178,8 @@ __gnat_initialize (void *eh) ...@@ -200,7 +178,8 @@ __gnat_initialize (void *eh)
LocalFree (wargv); LocalFree (wargv);
gnat_argc = argc_expanded; gnat_argc = argc_expanded;
adjust_arg (argc_expanded, &gnat_argv); gnat_argv = (char **) xrealloc
(gnat_argv, argc_expanded * sizeof (char *));
} }
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment