diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2023-01-27 20:53:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-27 11:53:57 -0800 |
| commit | 93a6b6119b6b65c4f6b00ca12d745e21b679c82f (patch) | |
| tree | 53bc1a3360d34ae6d15318eebf07245367387b9d /source | |
| parent | 9f6b6fb9f1bdde8ef01640257544f0e3c9db9076 (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.h | 9 |
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; |
