Reviewed-by: Samer El-Haj-Mahmoud <el...@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Andrew 
Fish
Sent: Thursday, October 22, 2015 10:54 AM
To: edk2-devel-01 <edk2-de...@ml01.01.org>
Subject: [edk2] [MdeModulePkg] RegularExpressionDxe does not link with Xcode 
6.3.2

I get linker errors that memcpy does not exist. The memcpy was generated by the 
compiler is response to a structure assignment with an =. 

Need to add in CopyMem to fix the issue:
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c
index 6dc6c28..c51ce34 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c
@@ -70,7 +70,10 @@ static void
 swap_node(Node* a, Node* b)
 {
   Node c;
-  c = *a; *a = *b; *b = c;
+  //c = *a; *a = *b; *b = c;
+  xmemcpy (&c, a, sizeof (Node));
+  xmemcpy (a, b, sizeof (Node));
+  xmemcpy (b, &c, sizeof (Node));
 
   if (NTYPE(a) == NT_STR) {
     StrNode* sn = NSTR(a);
@@ -4348,7 +4351,7 @@ clear_opt_map_info(OptMapInfo* map)  static void
 copy_opt_map_info(OptMapInfo* to, OptMapInfo* from)  {
-  *to = *from;
+  xmemcpy(to, from, sizeof(OptMapInfo));
 }
 
 static void
@@ -4463,7 +4466,7 @@ clear_node_opt_info(NodeOptInfo* opt)  static void
 copy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from)  {
-  *to = *from;
+  xmemcpy(to, from, sizeof (NodeOptInfo));
 }
 
 static void
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
index d7e645b..2a8ba93 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
@@ -2211,7 +2211,7 @@ onig_reduce_nested_quantifier(Node* pnode, Node* cnode)
 
   switch(ReduceTypeTable[cnum][pnum]) {
   case RQ_DEL:
-    *pnode = *cnode;
+    xmemcpy (pnode, cnode, sizeof (Node));
     break;
   case RQ_A:
     p->target = c->target;


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <af...@apple.com <mailto:af...@apple.com>>

Thanks,

Andrew Fish

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to