Menu

#1469 Code/documentation mismatch in Interpreter_instance.cpp

5.0.0
closed
Erich
None
none
1
2022-12-24
2017-07-06
No

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.

Discussion

  • Erich

    Erich - 2017-07-06
    • status: open --> pending
    • assigned_to: Erich
    • Pending work items: code+doc+test --> none
     
  • Erich

    Erich - 2017-07-06

    Committed code and doc fix with revision [r11267]
    The list can now be terminated by either handler = NULL or name = 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:

    environments[1].handler = NULL;
    environments[1].name = NULL;
    
     

    Related

    Commit: [r11267]

  • Gil Barmwater

    Gil Barmwater - 2022-12-24
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel