2015-04-18 18:29:01 +02:00
|
|
|
--- radiant/treemodel.cpp.orig 2006-02-10 22:01:20 UTC
|
|
|
|
+++ radiant/treemodel.cpp
|
2015-04-18 19:10:26 +02:00
|
|
|
@@ -710,7 +710,13 @@ public:
|
2015-04-18 18:29:01 +02:00
|
|
|
|
2015-04-18 19:10:26 +02:00
|
|
|
void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback)
|
2015-04-18 18:29:01 +02:00
|
|
|
{
|
2015-04-18 19:10:26 +02:00
|
|
|
- if(&node != 0)
|
2015-04-18 18:29:01 +02:00
|
|
|
+ // Reference cannot be bound to dereferenced null pointer in well-defined
|
|
|
|
+ // C++ code, and Clang will assume that comparison below always evaluates
|
2015-04-18 19:10:26 +02:00
|
|
|
+ // to true, resulting in a segmentation fault. Use a dirty hack to force
|
|
|
|
+ // Clang to check those "bad" references for null nonetheless.
|
2015-04-23 00:53:03 +02:00
|
|
|
+ volatile intptr_t n = (intptr_t)&node;
|
2015-04-18 18:29:01 +02:00
|
|
|
+
|
2015-04-18 19:10:26 +02:00
|
|
|
+ if(n != 0)
|
|
|
|
{
|
|
|
|
Nameable* nameable = Node_getNameable(node);
|
|
|
|
if(nameable != 0)
|
|
|
|
@@ -721,7 +727,9 @@ void node_attach_name_changed_callback(s
|
|
|
|
}
|
|
|
|
void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback)
|
|
|
|
{
|
|
|
|
- if(&node != 0)
|
2015-04-23 09:26:09 +02:00
|
|
|
+ volatile intptr_t n = (intptr_t)&node; // see the comment on line 713
|
2015-04-18 19:10:26 +02:00
|
|
|
+
|
|
|
|
+ if(n != 0)
|
|
|
|
{
|
|
|
|
Nameable* nameable = Node_getNameable(node);
|
|
|
|
if(nameable != 0)
|
|
|
|
@@ -1243,7 +1251,9 @@ const char* node_get_name(scene::Node& n
|
|
|
|
|
|
|
|
const char* node_get_name_safe(scene::Node& node)
|
|
|
|
{
|
|
|
|
- if(&node == 0)
|
2015-04-23 09:26:09 +02:00
|
|
|
+ volatile intptr_t n = (intptr_t)&node; // see the comment on line 713
|
2015-04-18 19:10:26 +02:00
|
|
|
+
|
2015-04-18 18:29:01 +02:00
|
|
|
+ if(n == 0)
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
2015-04-18 19:10:26 +02:00
|
|
|
@@ -1264,7 +1274,9 @@ GraphTreeNode* graph_tree_model_find_par
|
2015-04-18 18:29:01 +02:00
|
|
|
|
|
|
|
void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback)
|
|
|
|
{
|
|
|
|
- if(&node != 0)
|
2015-04-23 09:26:09 +02:00
|
|
|
+ volatile intptr_t n = (intptr_t)&node; // see the comment on line 713
|
2015-04-18 18:29:01 +02:00
|
|
|
+
|
|
|
|
+ if(n != 0)
|
|
|
|
{
|
|
|
|
Nameable* nameable = Node_getNameable(node);
|
|
|
|
if(nameable != 0)
|
2015-04-18 19:10:26 +02:00
|
|
|
@@ -1275,7 +1287,9 @@ void node_attach_name_changed_callback(s
|
2015-04-18 18:29:01 +02:00
|
|
|
}
|
|
|
|
void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback)
|
|
|
|
{
|
|
|
|
- if(&node != 0)
|
2015-04-23 09:26:09 +02:00
|
|
|
+ volatile intptr_t n = (intptr_t)&node; // see the comment on line 713
|
2015-04-18 18:29:01 +02:00
|
|
|
+
|
|
|
|
+ if(n != 0)
|
|
|
|
{
|
|
|
|
Nameable* nameable = Node_getNameable(node);
|
|
|
|
if(nameable != 0)
|