summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2023-01-27 20:53:57 +0100
committerGitHub <noreply@github.com>2023-01-27 11:53:57 -0800
commit93a6b6119b6b65c4f6b00ca12d745e21b679c82f (patch)
tree53bc1a3360d34ae6d15318eebf07245367387b9d /tools
parent9f6b6fb9f1bdde8ef01640257544f0e3c9db9076 (diff)
Add ASAN support + fixes (#2614)
* Add ASAN support to premake * Fix StringRepresentation when ASAN is enabled * Fix deep recursion in slang-generate * Fix hello-world example * Fix gpu-printing example * Linux fix * Try fixing linux * Add missing include
Diffstat (limited to 'tools')
-rw-r--r--tools/slang-generate/main.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/slang-generate/main.cpp b/tools/slang-generate/main.cpp
index 8e4824065..7d07cd613 100644
--- a/tools/slang-generate/main.cpp
+++ b/tools/slang-generate/main.cpp
@@ -56,8 +56,16 @@ struct SourceFile : public RefObject
{
if (text.begin())
free((void*)text.begin());
- if (node)
+
+ // To avoid deep recursion in the Node destructor,
+ // we delete the first level of the node tree iteratively.
+ while (node)
+ {
+ Node* next = node->next;
+ node->next = nullptr;
delete node;
+ node = next;
+ }
}
};