From: <bi...@us...> - 2012-06-07 11:16:06
|
Revision: 7853 http://oorexx.svn.sourceforge.net/oorexx/?rev=7853&view=rev Author: bigrixx Date: 2012-06-07 11:16:00 +0000 (Thu, 07 Jun 2012) Log Message: ----------- [ oorexx-Bugs-3532728 ] system breaks when string method has no Return Modified Paths: -------------- main/trunk/interpreter/classes/ObjectClass.cpp Modified: main/trunk/interpreter/classes/ObjectClass.cpp =================================================================== --- main/trunk/interpreter/classes/ObjectClass.cpp 2012-06-06 22:36:07 UTC (rev 7852) +++ main/trunk/interpreter/classes/ObjectClass.cpp 2012-06-07 11:16:00 UTC (rev 7853) @@ -1155,6 +1155,24 @@ {/* didn't convert? */ /* get the final string value */ this->sendMessage(OREF_STRINGSYM, string_value); + // we're really dependent upon the program respecting the protocol + // here and returning a value. It is possible there is a + // problem, so how to handle this. We could just raise an error, but this + // isn't the most ideal message since the error is raised at the + // line where the string value is required, but this is a rare + // situation. As a fallback, use the default object STRING method, + // then raise an error if we still don't get anything. This at least + // keeps the interpreter from crashing, there's a good chance the + // program will run. Frankly, there's something seriously wrong + // if this error ever gets issued. + if (string_value == OREF_NULL) + { + string_value = RexxObject::stringValue(); + if (string_value == OREF_NULL) + { + reportException(Error_No_result_object_message, OREF_STRINGSYM); + } + } // The returned value might be an Integer or NumberString value. We need to // force this to be a real string value. string_value = ((RexxObject *)string_value)->primitiveMakeString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |