+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>
* initialize.c: Do not get Unicode command line if Unicode support not
-- can be performed directly.
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 use the operand of the conversion on the right hand side as the
-- effective right hand side (the component types must match in this
#include "tsystem.h"
/* We don't have libiberty, so use malloc. */
#define xmalloc(S) malloc (S)
+#define xrealloc(V,S) realloc (V,S)
#else
#include "config.h"
#include "system.h"
if (*last < *index)
{
- char **old_argv = *argv;
- int old_last = *last;
- int k;
-
*last += EXPAND_ARGV_RATE;
- *argv = (char **) xmalloc ((*last) * sizeof (char *));
-
- for (k=0; k<=old_last; k++)
- (*argv)[k] = old_argv[k];
-
- free (old_argv);
+ *argv = (char **) xrealloc (*argv, (*last) * sizeof (char *));
}
size = WS2SC (NULL, value, 0);
(*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
void
LocalFree (wargv);
gnat_argc = argc_expanded;
- adjust_arg (argc_expanded, &gnat_argv);
+ gnat_argv = (char **) xrealloc
+ (gnat_argv, argc_expanded * sizeof (char *));
}
}
#endif