mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix ASAN warnings with Cycles OSL
This commit is contained in:
parent
1ace224c63
commit
a5fdff26b1
1 changed files with 13 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue