[llvm-commits] CVS: llvm-test/MultiSource/Applications/hbd/d6-arith.cpp decomp.cpp
Reid Spencer
reid at x10sys.com
Sun Nov 12 10:05:42 PST 2006
Changes in directory llvm-test/MultiSource/Applications/hbd:
d6-arith.cpp updated: 1.2 -> 1.3
decomp.cpp updated: 1.2 -> 1.3
---
Log message:
Fix array delete instances. This shuts up about 1300 errors from valgrind.
---
Diffs of the changes: (+5 -5)
d6-arith.cpp | 2 +-
decomp.cpp | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
Index: llvm-test/MultiSource/Applications/hbd/d6-arith.cpp
diff -u llvm-test/MultiSource/Applications/hbd/d6-arith.cpp:1.2 llvm-test/MultiSource/Applications/hbd/d6-arith.cpp:1.3
--- llvm-test/MultiSource/Applications/hbd/d6-arith.cpp:1.2 Fri May 13 13:10:44 2005
+++ llvm-test/MultiSource/Applications/hbd/d6-arith.cpp Sun Nov 12 12:05:27 2006
@@ -86,7 +86,7 @@
tmpstr = new char[100];
sprintf(tmpstr,"label%i", branch_pc);
buff = new char[strlen(tmpstr) + 1]; strcpy(buff, tmpstr);
- delete tmpstr;
+ delete [] tmpstr;
e1 = new Exp(pcval, buff, VOID/*label*/, IM);
*donestkptr++ = new Exp(pcval, PREUNARY, VOID, GOTO, e1, branch_pc);
return 0;
Index: llvm-test/MultiSource/Applications/hbd/decomp.cpp
diff -u llvm-test/MultiSource/Applications/hbd/decomp.cpp:1.2 llvm-test/MultiSource/Applications/hbd/decomp.cpp:1.3
--- llvm-test/MultiSource/Applications/hbd/decomp.cpp:1.2 Fri May 13 13:08:59 2005
+++ llvm-test/MultiSource/Applications/hbd/decomp.cpp Sun Nov 12 12:05:27 2006
@@ -248,7 +248,7 @@
l->type = LOOP_WHILE;
str = l->condition->toString(0);
fprintf(c->outfile, " while (%s) {\n", str);
- delete str;
+ delete [] str;
indentlevel++;
for (int i=indentlevel; i--;) fprintf(c->outfile, " ");
branchbacklist2->push(branchbacklist->pop());
@@ -272,7 +272,7 @@
char *str = l->condition->toString(0);
fprintf(c->outfile, " } while(%s);\t/*%d*/\n", str,
pptr->minpc);
- delete str;
+ delete [] str;
}
} else {
fprintf(c->outfile, " }\t/*%d*/\n", pptr->minpc);
@@ -308,7 +308,7 @@
fprintf(c->outfile, " %s;\t/*%d*/\n", str, (*(p-1))->minpc);
for (int i=indentlevel; i--;) fprintf(c->outfile, " ");
}
- delete str;
+ delete [] str;
fprintf(c->outfile, " }\n");
indentlevel--;
for (int i=indentlevel; i--;) fprintf(c->outfile, " ");
@@ -329,7 +329,7 @@
fprintf(c->outfile, "\n");
for (int i=indentlevel; i--;) fprintf(c->outfile, " ");
}
- delete str;
+ delete [] str;
}
}
fprintf(c->outfile, " }");
More information about the llvm-commits
mailing list