User:Hanya/Iif Problem
From Apache OpenOffice Wiki
Issue: https://issues.apache.org/ooo/show_bug.cgi?id=63614
Error code 87302 is produced when some code is modified contains Iif runtime function.
- Disassembled Original
Sub Main IIf(true, 1.0, "") End Sub
Position Op Op1 Op2 OpStr ----------------------------------------- 00000000 Lbl00000000: 00000000 45 00000000 JUMP Lbl0000 // Label ; Sub Main 00000005 Main: 00000005 87 00000003 00000000 STMNT 3,0 (For-Level: 0) ; IIf(true, 1.0, "") 0000000E 87 00000004 00000000 STMNT 4,0 (For-Level: 0) 00000017 18 ARGC // new argv 00000018 80 00000002 0000000C RTL true ; Variant 00000021 19 ARGV 00000022 40 00000004 NUMBER "1" 00000027 19 ARGV 00000028 41 00000005 STRING "" 0000002D 19 ARGV 0000002E 80 00008003 00000000 RTL IIf ; Empty, Args 00000037 1C GET ; End Sub 00000038 87 00000005 00000000 STMNT 5,0 (For-Level: 0) 00000041 2B LEAVE
- Disassembled with Problem
Second argument for IIf function is changed from 1.0 to "". Execute the code after the change -> strange error.
Sub Main IIf(true, "", "") End Sub
00000000 Lbl00000000: 00000000 45 00000000 JUMP Lbl0000 ; Sub Main 00000005 Main: 00000005 87 00000003 00000000 STMNT 3,0 (For-Level: 0) ; IIf(true, "", "") 0000000E 87 00000004 00000000 STMNT 4,0 (For-Level: 0) 00000017 18 ARGC 00000018 80 00000002 0000000C RTL true ; Variant 00000021 19 ARGV 00000022 41 00000004 STRING "" 00000027 19 ARGV 00000028 41 00000004 STRING "" 0000002D 19 ARGV 0000002E 80 00008003 00000002 RTL IIf ; Integer, Args 00000037 1C GET ; End Sub 00000038 87 00000005 00000000 STMNT 5,0 (For-Level: 0) 00000041 2B LEAVE
- Disassembled without Problem after Restarting
After the modification and error mentioned above, restart the office. And then execute the code, no error.
00000000 Lbl00000000: 00000000 45 00000000 JUMP Lbl0000 ; Sub Main 00000005 Main: 00000005 87 00000003 00000000 STMNT 3,0 (For-Level: 0) ; IIf(true, "", "") 0000000E 87 00000004 00000000 STMNT 4,0 (For-Level: 0) 00000017 18 ARGC 00000018 80 00000002 0000000C RTL true ; Variant 00000021 19 ARGV 00000022 41 00000004 STRING "" 00000027 19 ARGV 00000028 41 00000004 STRING "" 0000002D 19 ARGV 0000002E 80 00008003 00000000 RTL IIf ; Empty, Args 00000037 1C GET ; End Sub 00000038 87 00000005 00000000 STMNT 5,0 (For-Level: 0) 00000041 2B LEAVE
- Differences
With the same code, different operation codes are generated for IIf function.
// with problem 0000002E 80 00008003 00000002 RTL IIf ; Integer, Args // restarted 0000002E 80 00008003 00000000 RTL IIf ; Empty, Args
The error code 87302 is set in SbxValue::SetType (t is not equal to aData.eType) method. Therefore the problem is caused by the wrong compilation when the code is modified.