summaryrefslogtreecommitdiffstats
path: root/source
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 /source
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 'source')
-rw-r--r--source/core/slang-string.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/core/slang-string.h b/source/core/slang-string.h
index 028eec3e4..ecdba46be 100644
--- a/source/core/slang-string.h
+++ b/source/core/slang-string.h
@@ -315,6 +315,15 @@ namespace Slang
return cloneWithCapacity(newCapacity);
}
+
+ /// Overload delete to silence ASAN new-delete-type-mismatch errors.
+ /// These occur because the allocation size of StringRepresentation
+ /// does not match deallocation size (due variable sized string payload).
+ void operator delete(void* p)
+ {
+ StringRepresentation* str = (StringRepresentation*) p;
+ ::operator delete(str);
+ }
};
class String;