1.1 --- a/src/cpu/sparc/vm/macroAssembler_sparc.cpp Sat Mar 16 21:44:52 2013 -0700 1.2 +++ b/src/cpu/sparc/vm/macroAssembler_sparc.cpp Mon Mar 18 13:19:06 2013 +0100 1.3 @@ -1385,13 +1385,13 @@ 1.4 } 1.5 #endif 1.6 1.7 - int len = strlen(file) + strlen(msg) + 1 + 4; 1.8 - sprintf(buffer, "%d", line); 1.9 - len += strlen(buffer); 1.10 - sprintf(buffer, " at offset %d ", offset()); 1.11 - len += strlen(buffer); 1.12 - char * real_msg = new char[len]; 1.13 - sprintf(real_msg, "%s%s(%s:%d)", msg, buffer, file, line); 1.14 + const char* real_msg = NULL; 1.15 + { 1.16 + ResourceMark rm; 1.17 + stringStream ss; 1.18 + ss.print("%s at offset %d (%s:%d)", msg, offset(), file, line); 1.19 + real_msg = code_string(ss.as_string()); 1.20 + } 1.21 1.22 // Call indirectly to solve generation ordering problem 1.23 AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address()); 1.24 @@ -1423,13 +1423,13 @@ 1.25 // plausibility check for oops 1.26 if (!VerifyOops) return; 1.27 1.28 - char buffer[64]; 1.29 - sprintf(buffer, "%d", line); 1.30 - int len = strlen(file) + strlen(msg) + 1 + 4 + strlen(buffer); 1.31 - sprintf(buffer, " at SP+%d ", addr.disp()); 1.32 - len += strlen(buffer); 1.33 - char * real_msg = new char[len]; 1.34 - sprintf(real_msg, "%s at SP+%d (%s:%d)", msg, addr.disp(), file, line); 1.35 + const char* real_msg = NULL; 1.36 + { 1.37 + ResourceMark rm; 1.38 + stringStream ss; 1.39 + ss.print("%s at SP+%d (%s:%d)", msg, addr.disp(), file, line); 1.40 + real_msg = code_string(ss.as_string()); 1.41 + } 1.42 1.43 // Call indirectly to solve generation ordering problem 1.44 AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address()); 1.45 @@ -1622,9 +1622,13 @@ 1.46 // in order to run automated test scripts on the VM 1.47 // Use the flag ShowMessageBoxOnError 1.48 1.49 - char* b = new char[1024]; 1.50 - sprintf(b, "untested: %s", what); 1.51 - 1.52 + const char* b = NULL; 1.53 + { 1.54 + ResourceMark rm; 1.55 + stringStream ss; 1.56 + ss.print("untested: %s", what); 1.57 + b = code_string(ss.as_string()); 1.58 + } 1.59 if (ShowMessageBoxOnError) { STOP(b); } 1.60 else { warn(b); } 1.61 }