- xmalloc (new_actions_allocated * sizeof (actions_entry_t));
-
- memcpy (new_actions, old_actions,
- actions_allocated * sizeof (actions_entry_t));
+ XNMALLOC (new_actions_allocated, actions_entry_t);
+ size_t k;
+
+ /* Don't use memcpy() here, because memcpy takes non-volatile arguments
+ and is therefore not guaranteed to complete all memory stores before
+ the next statement. */
+ for (k = 0; k < old_actions_allocated; k++)
+ new_actions[k] = old_actions[k];