During some experimentation with the Native APIs, I discovered a bug in the implementation of the DIRECT_ENVIRONMENTS option of the RexxCreateInterpreter function. In section 8.1.2 of the Programmer Guide, (pg. 90 in the Release 5.0.0 version), it says "The list is terminated by an instance using a handler name of NULL." While this seemed to work when I only specified a single environment (as per Example 8.11. API - RexxOption), it failed as soon as I added a second environment. I was able to track down the problem by looking at the code that processes this option which is in ../main/trunk/interpreter/runtime/InterpreterInstance.cpp. At line 686, the for loop termination tests for the handler being NULL, not the handler name. When I changed my code to set the handler member to NULL
instead of the name member, I was able to specify multiple (tested through 5) environments. BTW, I checked the version of this file in the 4.0.0 release branch of the source tree and it is the same! So this bug has been around for a long time.
This was discovered on 32-bit v5.0.0 on 64-bit Windows 10.
Anonymous
Committed code and doc fix with revision [r11267]
The list can now be terminated by either
handler = NULL
orname = NULL
This should avoid breaking any existing code.
Also updated the example in rexxpg to set both handler and entry point to NULL for the terminator:
Related
Commit: [r11267]