https://issues.apache.org/ooo/show_bug.cgi?id=63614
--- Comment #12 from hanya <[email protected]> --- The parser tries to find the information of the function that called by _RTL pcode from the runtime library in SbiParser::CheckRTLForSym function. At first compilation of the code, the runtime library does not have any information about Iif function and its entry is created as SbxMethod instance and stored in SbxObject::pMethods array, see SbiStdObject::Find function. The runtime library is not cleared before the second compilation after the modification of the code. At first execution of the code, the SbxMethod instance created at the compilation is used to call Iif function. The type of return value is set at first execution of the runtime function. Iif is defined as RTLFUNC(Iif) (SbRtl_Iif function is generated by the macro) in basic/source/runtime/methods1.cxx file. If Iif is called like: Iif(true, 1, ""), the return type is going to be SbxINTEGER from the second argument in *rPar.Get(0) = *rPar.Get(2); line of the runtime funtion. In SbxValue::operator= function called at assignment of the return value, last Put method call set the type of return value of the function. SbxMethod::aData (declared in parent SbxValue class) instance variable is used to keep return value from the runtime function and its eType element is used to get its value type. Changes of SbxMethod::aData.eType - first compilation: SbxEMPTY as shown in disassembled code, this match with the function definition in basic/source/runtime/stdobj.cxx file - first execution: depends on the condition and return value of Iif function - second compilation: depends on the result of the last call of Iif function At the second compilation, SbxMethod instance for Iif function having the last value of the function call, is used to obtain the function information. The compilation result is unstable like described in the Comment 11. Return value of most runtime functions are always same type, so this problem revealed on Iif function since its return type can be changed by the coder. -- You are receiving this mail because: You are on the CC list for the issue. You are watching all issue changes.
