From: <bi...@us...> - 2009-07-22 20:59:00
|
Revision: 4980 http://oorexx.svn.sourceforge.net/oorexx/?rev=4980&view=rev Author: bigrixx Date: 2009-07-22 20:58:58 +0000 (Wed, 22 Jul 2009) Log Message: ----------- [ oorexx-Bugs-2825541 ] Sourceline did not return data Modified Paths: -------------- main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.cpp main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.hpp main/branches/4.0beta/trunk/interpreter/expression/BuiltinFunctions.cpp Modified: main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.cpp =================================================================== --- main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.cpp 2009-07-22 20:58:27 UTC (rev 4979) +++ main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.cpp 2009-07-22 20:58:58 UTC (rev 4980) @@ -160,8 +160,6 @@ this->executable = _method; // save this as the base executable // save the source object reference also this->sourceObject = _method->getSourceObject(); - // save the source object reference also - this->sourceObject = _method->getSourceObject(); this->settings.intermediate_trace = false; this->activation_context = METHODCALL; // the context is a method call this->parent = OREF_NULL; // we don't have a parent stack frame when invoked as a method Modified: main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.hpp =================================================================== --- main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.hpp 2009-07-22 20:58:27 UTC (rev 4979) +++ main/branches/4.0beta/trunk/interpreter/execution/RexxActivation.hpp 2009-07-22 20:58:58 UTC (rev 4980) @@ -311,12 +311,15 @@ void closeStreams(); void checkTrapTable(); RexxObject *resolveStream(RexxString *name, bool input, RexxString **fullName, bool *added); - RexxDirectory * getStreams(); - RexxObject *novalueHandler(RexxString *); + RexxDirectory *getStreams(); + RexxObject *novalueHandler(RexxString *); RexxVariableBase *retriever(RexxString *); RexxVariableBase *directRetriever(RexxString *); RexxObject *handleNovalueEvent(RexxString *name, RexxVariable *variable); RexxSource *getSourceObject() { return sourceObject; } + inline RexxSource *getEffectiveSourceObject() { + return isInterpret() ? executable->getSourceObject() : sourceObject; + } PackageClass *getPackage(); RexxObject *getExecutableObject() { return executable; } RexxObject *getLocalEnvironment(RexxString *name); Modified: main/branches/4.0beta/trunk/interpreter/expression/BuiltinFunctions.cpp =================================================================== --- main/branches/4.0beta/trunk/interpreter/expression/BuiltinFunctions.cpp 2009-07-22 20:58:27 UTC (rev 4979) +++ main/branches/4.0beta/trunk/interpreter/expression/BuiltinFunctions.cpp 2009-07-22 20:58:58 UTC (rev 4980) @@ -1814,7 +1814,9 @@ BUILTIN(SOURCELINE) { fix_args(SOURCELINE); /* check on required number of args */ - RexxSource *source = context->getSourceObject(); /* get current source object */ + // get the effective source object. If we're in an interpret context, this will + // be the one of our caller. + RexxSource *source = context->getEffectiveSourceObject(); size_t size = source->sourceSize(); /* get the program size */ if (argcount == 1) /* asking for a specific line? */ { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |