From 8157aa285b192f1ee25847f37a56b35cf8313ff3 Mon Sep 17 00:00:00 2001
From: abv <abv@opencascade.com>
Date: Fri, 29 Sep 2017 11:18:11 +0300
Subject: [PATCH] 0029160: Coding - AppleCLang 9 compiler warning "binding
 dereferenced null pointer to reference has undefined behavior"

Avoid returning reference to null in AppDef_MyLineTool
---
 src/AppDef/AppDef_MyLineTool.cxx |  4 ++--
 src/AppDef/AppDef_MyLineTool.hxx | 23 +----------------------
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/src/AppDef/AppDef_MyLineTool.cxx b/src/AppDef/AppDef_MyLineTool.cxx
index 93827b115e..3bc30bc204 100644
--- a/src/AppDef/AppDef_MyLineTool.cxx
+++ b/src/AppDef/AppDef_MyLineTool.cxx
@@ -138,12 +138,12 @@ Standard_Boolean AppDef_MyLineTool::Tangency(const AppDef_MultiLine& ML,
 }
 
 
-AppDef_MultiLine& AppDef_MyLineTool::MakeMLBetween(const AppDef_MultiLine&,
+AppDef_MultiLine AppDef_MyLineTool::MakeMLBetween(const AppDef_MultiLine& theML,
 						   const Standard_Integer ,
 						   const Standard_Integer ,
 						   const Standard_Integer )
 {
-  return *((AppDef_MultiLine*) 0);
+  return theML; // stub
 }
 
 Standard_Boolean AppDef_MyLineTool::MakeMLOneMorePoint(const AppDef_MultiLine& ,
diff --git a/src/AppDef/AppDef_MyLineTool.hxx b/src/AppDef/AppDef_MyLineTool.hxx
index 7f6917751f..b40b26de7a 100644
--- a/src/AppDef/AppDef_MyLineTool.hxx
+++ b/src/AppDef/AppDef_MyLineTool.hxx
@@ -94,7 +94,7 @@ public:
   
   //! Is never called in the algorithms.
   //! Nothing is done.
-  Standard_EXPORT static AppDef_MultiLine& MakeMLBetween (const AppDef_MultiLine& ML,
+  Standard_EXPORT static AppDef_MultiLine MakeMLBetween (const AppDef_MultiLine& ML,
                                                           const Standard_Integer I1,
                                                           const Standard_Integer I2,
                                                           const Standard_Integer NbPMin);
@@ -106,27 +106,6 @@ public:
                                                                 const Standard_Integer I2,
                                                                 const Standard_Integer indbad,
                                                                 AppDef_MultiLine& OtherLine);
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _AppDef_MyLineTool_HeaderFile