harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r653229 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp
Date Sun, 04 May 2008 15:20:46 GMT
Author: gshimansky
Date: Sun May  4 08:20:46 2008
New Revision: 653229

URL: http://svn.apache.org/viewvc?rev=653229&view=rev
Log:
Fixed memory allocation bug introduced in 653183


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp?rev=653229&r1=653228&r2=653229&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/ver.cpp Sun May  4 08:20:46
2008
@@ -207,11 +207,13 @@
     const char* cname = class_get_name(method_get_class(method));
     const char* mname = method_get_name(method);
     const char* mdesc = method_get_descriptor(method);
+    const char *format = "%s.%s%s, pass: %s, instr: %s, reason: %s";
     unsigned msg_len = strlen(cname) + strlen(mname) + strlen(mdesc)
-        + strlen(pass) + strlen(instr) + strlen(context.error_message) + 1;
+        + strlen(pass) + strlen(instr) + strlen(context.error_message) +
+        strlen(format);
     *error_msg = (char*)tc_malloc(msg_len);
     if(*error_msg != NULL) {
-        sprintf(*error_msg, "%s.%s%s, pass: %s, instr: %s, reason: %s",
+        sprintf(*error_msg, format,
             cname, mname, mdesc, pass, instr, context.error_message);
     }
 }
@@ -219,10 +221,11 @@
 void vf_create_error_message(Class_Handle klass, vf_TypeConstraint* constraint, char** error_msg)
 {
     const char* cname = class_get_name(klass);
+    const char *format = "constraint check failed, class: %s, source: %s, target: %s";
     unsigned msg_len = strlen(cname) +
         + strlen(constraint->source)
-        + strlen(constraint->target) + 1;
+        + strlen(constraint->target) + strlen(format);
     *error_msg = (char*)tc_malloc(msg_len);
-    sprintf(*error_msg, "constraint check failed, class: %s, source: %s, target: %s",
+    sprintf(*error_msg, format,
         cname, constraint->source, constraint->target);
 }



Mime
View raw message