MdeModulePkg: Fix RegularExpressionDxe memcpy intrinsic.

Use explicit CopyMem to resolve intrinsic memcpy errors on some compilers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19292 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Samer El-Haj-Mahmoud 2015-12-16 02:46:53 +00:00 committed by shenshushi
parent 65e5838287
commit b2e3542666
2 changed files with 9 additions and 7 deletions

View File

@ -70,7 +70,9 @@ static void
swap_node(Node* a, Node* b) swap_node(Node* a, Node* b)
{ {
Node c; Node c;
c = *a; *a = *b; *b = c; CopyMem (&c, a, sizeof (Node));
CopyMem (a, b, sizeof (Node));
CopyMem (b, &c, sizeof (Node));
if (NTYPE(a) == NT_STR) { if (NTYPE(a) == NT_STR) {
StrNode* sn = NSTR(a); StrNode* sn = NSTR(a);
@ -4113,7 +4115,7 @@ alt_merge_mml(MinMaxLen* to, MinMaxLen* from)
static void static void
copy_opt_env(OptEnv* to, OptEnv* from) copy_opt_env(OptEnv* to, OptEnv* from)
{ {
*to = *from; CopyMem (to, from, sizeof (OptEnv));
} }
static void static void
@ -4126,7 +4128,7 @@ clear_opt_anc_info(OptAncInfo* anc)
static void static void
copy_opt_anc_info(OptAncInfo* to, OptAncInfo* from) copy_opt_anc_info(OptAncInfo* to, OptAncInfo* from)
{ {
*to = *from; CopyMem (to, from, sizeof (OptAncInfo));
} }
static void static void
@ -4210,7 +4212,7 @@ clear_opt_exact_info(OptExactInfo* ex)
static void static void
copy_opt_exact_info(OptExactInfo* to, OptExactInfo* from) copy_opt_exact_info(OptExactInfo* to, OptExactInfo* from)
{ {
*to = *from; CopyMem (to, from, sizeof (OptExactInfo));
} }
static void static void
@ -4358,7 +4360,7 @@ clear_opt_map_info(OptMapInfo* map)
static void static void
copy_opt_map_info(OptMapInfo* to, OptMapInfo* from) copy_opt_map_info(OptMapInfo* to, OptMapInfo* from)
{ {
*to = *from; CopyMem (to, from, sizeof (OptMapInfo));
} }
static void static void
@ -4473,7 +4475,7 @@ clear_node_opt_info(NodeOptInfo* opt)
static void static void
copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from) copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from)
{ {
*to = *from; CopyMem (to, from, sizeof (NodeOptInfo));
} }
static void static void

View File

@ -2217,7 +2217,7 @@ onig_reduce_nested_quantifier(Node* pnode, Node* cnode)
switch(ReduceTypeTable[cnum][pnum]) { switch(ReduceTypeTable[cnum][pnum]) {
case RQ_DEL: case RQ_DEL:
*pnode = *cnode; CopyMem (pnode, cnode, sizeof (Node));
break; break;
case RQ_A: case RQ_A:
p->target = c->target; p->target = c->target;