diff -r 50c604cb0d5f -r 30245956af37 hotspot/src/share/vm/oops/symbol.cpp --- a/hotspot/src/share/vm/oops/symbol.cpp Mon Jul 23 13:04:59 2012 -0700 +++ b/hotspot/src/share/vm/oops/symbol.cpp Tue Jul 24 10:51:00 2012 -0700 @@ -96,7 +96,7 @@ address scan = bytes + i; if (scan > limit) return -1; - for (;;) { + for (; scan <= limit; scan++) { scan = (address) memchr(scan, first_char, (limit + 1 - scan)); if (scan == NULL) return -1; // not found @@ -104,6 +104,7 @@ if (memcmp(scan, str, len) == 0) return (int)(scan - bytes); } + return -1; }