Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-04-29 15:56:49 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-04-29 16:58:51 +0300
commita5fdff26b1f3d9765fc28be780c281e90402fe85 (patch)
tree9088f7d065f29b863c097815d410c74426260e10 /intern
parent1ace224c633df1a00d1a73f18c579520fcc92411 (diff)
Fix ASAN warnings with Cycles OSL
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/nodes.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index fb9cf0c9836..99cb0b779b8 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -1600,11 +1600,23 @@ class SetNormalNode : public ShaderNode {
NODE_SOCKET_API(float3, direction)
};
-class OSLNode : public ShaderNode {
+class OSLNode final : public ShaderNode {
public:
static OSLNode *create(ShaderGraph *graph, size_t num_inputs, const OSLNode *from = NULL);
~OSLNode();
+ static void operator delete(void *ptr)
+ {
+ /* Override delete operator to silence new-delete-type-mismatch ASAN warnings
+ * regarding size mismatch in the destructor. This is intentional as we allocate
+ * extra space at the end of the node. */
+ ::operator delete(ptr);
+ }
+ static void operator delete(void *, void *)
+ {
+ /* Deliberately empty placement delete operator, to avoid MSVC warning C4291. */
+ }
+
ShaderNode *clone(ShaderGraph *graph) const;
char *input_default_value();