aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2015-04-18 17:10:26 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2015-04-18 17:10:26 +0000
commite8336524e2322e277545bba47b7eccef4b43e972 (patch)
tree8a0c46050d1cc8ca928c0ee140694c6d53b09666 /games
parentb2d906151996ece8b94d8120c7cf6a24e666aacf (diff)
downloadports-e8336524e2322e277545bba47b7eccef4b43e972.tar.gz
ports-e8336524e2322e277545bba47b7eccef4b43e972.zip
Oops, incomplete version of the patch was committed in r384239.
Notes
Notes: svn path=/head/; revision=384241
Diffstat (limited to 'games')
-rw-r--r--games/gtkradiant/files/patch-radiant_treemodel.cpp40
1 files changed, 31 insertions, 9 deletions
diff --git a/games/gtkradiant/files/patch-radiant_treemodel.cpp b/games/gtkradiant/files/patch-radiant_treemodel.cpp
index bffe327ae1af..cfe71cd62be9 100644
--- a/games/gtkradiant/files/patch-radiant_treemodel.cpp
+++ b/games/gtkradiant/files/patch-radiant_treemodel.cpp
@@ -1,37 +1,59 @@
--- radiant/treemodel.cpp.orig 2006-02-10 22:01:20 UTC
+++ radiant/treemodel.cpp
-@@ -1243,7 +1243,13 @@ const char* node_get_name(scene::Node& n
+@@ -710,7 +710,13 @@ public:
- const char* node_get_name_safe(scene::Node& node)
+ void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback)
{
-- if(&node == 0)
+- if(&node != 0)
+ // Reference cannot be bound to dereferenced null pointer in well-defined
+ // C++ code, and Clang will assume that comparison below always evaluates
-+ // to false, resulting in segmentation fault. Use a dirty hack to insist
-+ // that Clang checks it for null.
++ // to true, resulting in a segmentation fault. Use a dirty hack to force
++ // Clang to check those "bad" references for null nonetheless.
+ volatile int n = (int)&node;
+
++ 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)
++ volatile int n = (int)&node; // see the comment on line 713
++
++ 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)
++ volatile int n = (int)&node; // see the comment on line 713
++
+ if(n == 0)
{
return "";
}
-@@ -1264,7 +1270,9 @@ GraphTreeNode* graph_tree_model_find_par
+@@ -1264,7 +1274,9 @@ GraphTreeNode* graph_tree_model_find_par
void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback)
{
- if(&node != 0)
-+ volatile int n = (int)&node; // see the comment on line 1246
++ volatile int n = (int)&node; // see the comment on line 713
+
+ if(n != 0)
{
Nameable* nameable = Node_getNameable(node);
if(nameable != 0)
-@@ -1275,7 +1283,9 @@ void node_attach_name_changed_callback(s
+@@ -1275,7 +1287,9 @@ void node_attach_name_changed_callback(s
}
void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback)
{
- if(&node != 0)
-+ volatile int n = (int)&node; // see the comment on line 1246
++ volatile int n = (int)&node; // see the comment on line 713
+
+ if(n != 0)
{