Fix ASAN warnings with Cycles OSL
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user