|
From: <sv...@va...> - 2010-08-20 18:24:25
|
Author: sewardj
Date: 2010-08-20 19:24:16 +0100 (Fri, 20 Aug 2010)
New Revision: 11270
Log:
Add in comments a (validated) strspn replacement, should it become
necessary.
Modified:
trunk/memcheck/mc_replace_strmem.c
Modified: trunk/memcheck/mc_replace_strmem.c
===================================================================
--- trunk/memcheck/mc_replace_strmem.c 2010-08-20 18:22:07 UTC (rev 11269)
+++ trunk/memcheck/mc_replace_strmem.c 2010-08-20 18:24:16 UTC (rev 11270)
@@ -984,6 +984,36 @@
#endif
+// And here's a validated strspn replacement, should it
+// become necessary.
+//UWord mystrspn( UChar* s, UChar* accept )
+//{
+// /* find the length of 'accept', not including terminating zero */
+// UWord nacc = 0;
+// while (accept[nacc]) nacc++;
+// if (nacc == 0) return 0;
+//
+// UWord len = 0;
+// while (1) {
+// UWord i;
+// UChar sc = *s;
+// if (sc == 0)
+// break;
+// for (i = 0; i < nacc; i++) {
+// if (sc == accept[i])
+// break;
+// }
+// assert(i >= 0 && i <= nacc);
+// if (i == nacc)
+// break;
+// s++;
+// len++;
+// }
+//
+// return len;
+//}
+
+
/*------------------------------------------------------------*/
/*--- Improve definedness checking of process environment ---*/
/*------------------------------------------------------------*/
|
|
From: Christoph B. <bar...@or...> - 2011-06-03 08:55:48
|
Hi,
has this strspn already been activated?
I get the following error with valgrind 3.6.1 from opensuse 11.4:
==00:08:50:58.719 17760== Invalid read of size 8
==00:08:50:58.719 17760== at 0x5AD3A44: __strspn_sse42 (in
/lib64/libc-2.11.3.so)
...
==00:08:50:58.719 17760== Address 0x1d15bf878 is 0 bytes after a block
of size 65,496 alloc'd
==00:08:50:58.719 17760== at 0x4C2683D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
...
Christoph
Am 20.08.2010 20:24, schrieb sv...@va...:
> Author: sewardj
> Date: 2010-08-20 19:24:16 +0100 (Fri, 20 Aug 2010)
> New Revision: 11270
>
> Log:
> Add in comments a (validated) strspn replacement, should it become
> necessary.
>
>
>
> Modified:
> trunk/memcheck/mc_replace_strmem.c
>
>
> Modified: trunk/memcheck/mc_replace_strmem.c
> ===================================================================
> --- trunk/memcheck/mc_replace_strmem.c 2010-08-20 18:22:07 UTC (rev 11269)
> +++ trunk/memcheck/mc_replace_strmem.c 2010-08-20 18:24:16 UTC (rev 11270)
> @@ -984,6 +984,36 @@
> #endif
>
>
> +// And here's a validated strspn replacement, should it
> +// become necessary.
> +//UWord mystrspn( UChar* s, UChar* accept )
> +//{
> +// /* find the length of 'accept', not including terminating zero */
> +// UWord nacc = 0;
> +// while (accept[nacc]) nacc++;
> +// if (nacc == 0) return 0;
> +//
> +// UWord len = 0;
> +// while (1) {
> +// UWord i;
> +// UChar sc = *s;
> +// if (sc == 0)
> +// break;
> +// for (i = 0; i< nacc; i++) {
> +// if (sc == accept[i])
> +// break;
> +// }
> +// assert(i>= 0&& i<= nacc);
> +// if (i == nacc)
> +// break;
> +// s++;
> +// len++;
> +// }
> +//
> +// return len;
> +//}
> +
> +
> /*------------------------------------------------------------*/
> /*--- Improve definedness checking of process environment ---*/
> /*------------------------------------------------------------*/
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|
|
From: Julian S. <js...@ac...> - 2011-06-03 09:10:20
|
On Friday, June 03, 2011, Christoph Bartoschek wrote: > Hi, > > has this strspn already been activated? No, it hasn't -- it's still commented out in the trunk sources. Try uncommenting it, commenting out the assert, and adding the relevant macro defn and use. See strcspn immediately above for an example. If it works, pls send the resulting patch. J |
|
From: Дмитрий Д. <di...@gm...> - 2011-06-03 13:52:22
|
FYI: * *https://bugs.kde.org/show_bug.cgi?id=270925 done *2011-04-14 * Dmitry 2011/6/3 Julian Seward <js...@ac...> > On Friday, June 03, 2011, Christoph Bartoschek wrote: > > Hi, > > > > has this strspn already been activated? > > No, it hasn't -- it's still commented out in the trunk sources. > > Try uncommenting it, commenting out the assert, and adding the > relevant macro defn and use. See strcspn immediately above for > an example. If it works, pls send the resulting patch. > > J > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |