summaryrefslogtreecommitdiff
path: root/src/ast-parser-lexer-shared.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-03-06 11:34:37 -0800
committerGitHub <noreply@github.com>2017-03-06 11:34:37 -0800
commite4dda12b17a5323a56b6782a6787f258ed2d8c81 (patch)
treec47e34928fc9b48f5b8dd1579e4c0213074b6494 /src/ast-parser-lexer-shared.cc
parentb6e5735f3bfbb66d76142fc2f404da796289fc76 (diff)
downloadwabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.tar.gz
wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.tar.bz2
wabt-e4dda12b17a5323a56b6782a6787f258ed2d8c81.zip
Use new/delete instead of malloc/free (#332)
Also switch some void* -> char*, because it removes some unnecessary casts. C++ does not like void*.
Diffstat (limited to 'src/ast-parser-lexer-shared.cc')
-rw-r--r--src/ast-parser-lexer-shared.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ast-parser-lexer-shared.cc b/src/ast-parser-lexer-shared.cc
index 08d9ad8c..7e5eb0b5 100644
--- a/src/ast-parser-lexer-shared.cc
+++ b/src/ast-parser-lexer-shared.cc
@@ -81,7 +81,7 @@ void destroy_optional_export(OptionalExport* export_) {
void destroy_exported_func(ExportedFunc* exported_func) {
destroy_optional_export(&exported_func->export_);
destroy_func(exported_func->func);
- wabt_free(exported_func->func);
+ delete exported_func->func;
}
void destroy_text_list(TextList* text_list) {
@@ -89,7 +89,7 @@ void destroy_text_list(TextList* text_list) {
while (node) {
TextListNode* next = node->next;
destroy_string_slice(&node->text);
- wabt_free(node);
+ delete node;
node = next;
}
}
@@ -116,7 +116,7 @@ void destroy_func_fields(FuncField* func_field) {
break;
}
- wabt_free(func_field);
+ delete func_field;
func_field = next_func_field;
}
}