[llvm-commits] CVS: llvm-test/MultiSource/Applications/hbd/class.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri May 13 11:08:08 PDT 2005
Changes in directory llvm-test/MultiSource/Applications/hbd:
class.cpp updated: 1.1 -> 1.2
---
Log message:
fix problems with new[]/delete
---
Diffs of the changes: (+5 -5)
class.cpp | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
Index: llvm-test/MultiSource/Applications/hbd/class.cpp
diff -u llvm-test/MultiSource/Applications/hbd/class.cpp:1.1 llvm-test/MultiSource/Applications/hbd/class.cpp:1.2
--- llvm-test/MultiSource/Applications/hbd/class.cpp:1.1 Fri Feb 27 12:06:47 2004
+++ llvm-test/MultiSource/Applications/hbd/class.cpp Fri May 13 13:07:50 2005
@@ -55,7 +55,7 @@
fprintf(stderr, "Could not open file %s\n", argv[1]);
goto defaultcase_hbt;
}
- delete tmpstr;
+ delete [] tmpstr;
break;
default: defaultcase_hbt:
fatalerror(COMMAND_LINE_ERR_HBT, progname);
@@ -209,7 +209,7 @@
for (tint = numimports - 2; tint>=0; tint--) {
if (!strcmp(imports[tint], tstr)) {
--numimports;
- delete tstr;
+ delete [] tstr;
break;
}
}
@@ -252,7 +252,7 @@
for (tint = numimports - 2; tint>=0; tint--) {
if (!strcmp(imports[tint], tstr)) {
--numimports;
- delete tstr;
+ delete [] tstr;
break;
}
}
@@ -358,7 +358,7 @@
fprintf(outfile, "\n");
char *tmpstr = new char[access_flags.strlen() + 1];
fprintf(outfile, "%sclass %s ", access_flags.toString(tmpstr), this_class_name);
- delete tmpstr;
+ delete [] tmpstr;
if (super_class) {
if (!strcmp(tmpstr = cp(super_class)->chp, "Object")) {
super_class_name = "Object";
@@ -380,7 +380,7 @@
field_info &fi = *(fields[j++]);
tmpstr = new char[fi.access_flags.strlen() + 1];
fprintf(outfile, "\n %s", fi.access_flags.toString(tmpstr));
- delete tmpstr;
+ delete [] tmpstr;
tmpstr = fi.sig;
printsigname(this, outfile, tmpstr, fi.name, 0);
if (fi.isconstant) {
More information about the llvm-commits
mailing list