Date: Sat, 18 Apr 2015 17:10:27 +0000 (UTC) From: Alexey Dokuchaev <danfe@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r384241 - head/games/gtkradiant/files Message-ID: <201504181710.t3IHARLt061619@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: danfe Date: Sat Apr 18 17:10:26 2015 New Revision: 384241 URL: https://svnweb.freebsd.org/changeset/ports/384241 Log: Oops, incomplete version of the patch was committed in r384239. Modified: head/games/gtkradiant/files/patch-radiant_treemodel.cpp Modified: head/games/gtkradiant/files/patch-radiant_treemodel.cpp ============================================================================== --- head/games/gtkradiant/files/patch-radiant_treemodel.cpp Sat Apr 18 16:39:18 2015 (r384240) +++ head/games/gtkradiant/files/patch-radiant_treemodel.cpp Sat Apr 18 17:10:26 2015 (r384241) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504181710.t3IHARLt061619>