# HG changeset patch # User kvn # Date 1296584822 28800 # Node ID ec9e977dd8e4023dc1196b60218423b32687c97f # Parent 2e85cdf7257079bc46793f0d412dd01317501aaa 7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series Summary: Use substring search instead of compare and convert string to upper case before search. Reviewed-by: never, phh, iveresov diff -r 2e85cdf72570 -r ec9e977dd8e4 src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp --- a/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Tue Feb 01 19:25:37 2011 -0800 +++ b/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Tue Feb 01 10:27:02 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -189,14 +189,22 @@ tty->print_cr("cpu_info.implementation: %s", implementation); } #endif - if (strncmp(implementation, "SPARC64", 7) == 0) { + // Convert to UPPER case before compare. + char* impl = strdup(implementation); + + for (int i = 0; impl[i] != 0; i++) + impl[i] = (char)toupper((uint)impl[i]); + if (strstr(impl, "SPARC64") != NULL) { features |= sparc64_family_m; - } else if (strncmp(implementation, "UltraSPARC-T", 12) == 0) { + } else if (strstr(impl, "SPARC-T") != NULL) { features |= T_family_m; - if (strncmp(implementation, "UltraSPARC-T1", 13) == 0) { + if (strstr(impl, "SPARC-T1") != NULL) { features |= T1_model_m; } + } else { + assert(strstr(impl, "SPARC") != NULL, "should be sparc"); } + free((void*)impl); break; } } // for(