OSDN Git Service

regex: call memcpy() ourselves
authorMike Frysinger <vapier@gentoo.org>
Thu, 22 Oct 2009 05:04:07 +0000 (01:04 -0400)
committerAustin Foxley <austinf@cetoncorp.com>
Mon, 9 Nov 2009 23:34:07 +0000 (15:34 -0800)
Call the hidden memcpy() ourselves otherwise gcc will emit a call to the
public memcpy() which goes through the PLT.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
libc/misc/regex/regex_old.c

index 3550698..cbfb7ae 100644 (file)
@@ -8085,7 +8085,8 @@ regexec (
   int len = strlen (string);
   boolean want_reg_info = !preg->no_sub && nmatch > 0;
 
-  private_preg = *preg;
+  /* use hidden memcpy() ourselves rather than gcc calling public memcpy() */
+  memcpy(&private_preg, preg, sizeof(*preg));
 
   private_preg.not_bol = !!(eflags & REG_NOTBOL);
   private_preg.not_eol = !!(eflags & REG_NOTEOL);