<div dir="ltr">I got:<div><br></div><div><div style="padding:0px 0px 0px 2px"><div style="color:rgb(0,0,0);font-family:Consolas;font-size:10pt;white-space:pre"><p style="margin:0px"><span style="color:rgb(255,0,0)">Exception in thread "main" </span><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">java.lang.IllegalArgumentException</span><span style="color:rgb(255,0,0)">: Operand stack underflow at bytecode offset 26 of method _STM()</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">  - max stack: 65535</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    max locals: 65535</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    attributes: []</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    //stack map frame @0: {locals: [simulaTestPrograms/adHoc01_P_TXT2], stack: []}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    0: {opcode: ALOAD_0, slot: 0}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    1: {opcode: GETFIELD, owner: simulaTestPrograms/adHoc01_P_TXT2, field name: P_T, field type: Lsimula/runtime/RTS_TXT;}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    4: {opcode: NEW, type: simulaTestPrograms/adHoc01_P_TXT2}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    7: {opcode: DUP}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    8: {opcode: ALOAD_0, slot: 0}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    9: {opcode: GETFIELD, owner: simula/runtime/RTS_RTObject, field name: _SL, field type: Lsimula/runtime/RTS_RTObject;}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    12: {opcode: CHECKCAST, type: simulaTestPrograms/adHoc01}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    15: {opcode: INVOKESPECIAL, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: <init>, method type: (Lsimula/runtime/RTS_RTObject;Lsimula/runtime/RTS_TXT;)V}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    18: {opcode: GETFIELD, owner: simulaTestPrograms/adHoc01_P_TXT2, field name: _RESULT, field type: Lsimula/runtime/RTS_TXT;}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    21: {opcode: LDC, constant value: Abra}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    23: {opcode: INVOKESTATIC, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: _ASGSTR, method type: (Lsimula/runtime/RTS_TXT;Ljava/lang/String;)Lsimula/runtime/RTS_TXT;}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    26: {opcode: INVOKESTATIC, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: _ASGTXT, method type: (Lsimula/runtime/RTS_TXT;Lsimula/runtime/RTS_TXT;)Lsimula/runtime/RTS_TXT;}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    29: {opcode: POP}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    30: {opcode: ALOAD_0, slot: 0}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    31: {opcode: INVOKEVIRTUAL, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: EBLK, method type: ()V}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    34: {opcode: ALOAD_0, slot: 0}</span></p><p style="margin:0px"><span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid"></span><span style="color:rgb(255,0,0)">    35: {opcode: ARETURN}</span></p><p style="margin:0px"></p></div></div><div><br></div><div>Then I monitor the operand stack as follows:</div><div><br></div><div>    0: {opcode: ALOAD_0, slot: 0}<br>    1: {opcode: GETFIELD, owner: simulaTestPrograms/adHoc01_P_TXT2, field name: P_T, field type: Lsimula/runtime/RTS_TXT;}<br>     ==> STACK: this.P_T<br><br>    4: {opcode: NEW, type: simulaTestPrograms/adHoc01_P_TXT2}<br>     ==> STACK: P_TXT2, this.P_T<br><br>    7: {opcode: DUP}<br>      ==> STACK: P_TXT2, P_TXT2, this.P_T<br><br>    8: {opcode: ALOAD_0, slot: 0}<br>    9: {opcode: GETFIELD, owner: simula/runtime/RTS_RTObject, field name: _SL, field type: Lsimula/runtime/RTS_RTObject;}<br>    12: {opcode: CHECKCAST, type: simulaTestPrograms/adHoc01}<br>   ==> STACK: this.SL, P_TXT2, P_TXT2, this.P_T<br><br>    15: {opcode: INVOKESPECIAL, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: <init>, method type: (Lsimula/runtime/RTS_RTObject;Lsimula/runtime/RTS_TXT;)V}<br>      ==> STACK: P_TXT2, this.P_T<br><br>    18: {opcode: GETFIELD, owner: simulaTestPrograms/adHoc01_P_TXT2, field name: _RESULT, field type: Lsimula/runtime/RTS_TXT;}<br>   ==> STACK: P_TXT2.RESULT, this.P_T<br><br>    21: {opcode: LDC, constant value: Abra}<br>        ==> STACK: "Abra", P_TXT2.RESULT, this.P_T<br><br>    23: {opcode: INVOKESTATIC, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: _ASGSTR, method type: (Lsimula/runtime/RTS_TXT;Ljava/lang/String;)Lsimula/runtime/RTS_TXT;}<br>        ==> STACK: Return-value-1, this.P_T<br><br>    26: {opcode: INVOKESTATIC, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: _ASGTXT, method type: (Lsimula/runtime/RTS_TXT;Lsimula/runtime/RTS_TXT;)Lsimula/runtime/RTS_TXT;}<br>   ==> STACK: Return-value-2<br><br>    29: {opcode: POP}<br>       ==> STACK: <br><br>    30: {opcode: ALOAD_0, slot: 0}<br>    31: {opcode: INVOKEVIRTUAL, owner: simulaTestPrograms/adHoc01_P_TXT2, method name: EBLK, method type: ()V}<br>    34: {opcode: ALOAD_0, slot: 0}<br>    35: {opcode: ARETURN}<br></div><div><br></div><div>This shows that the error 'Operand stack underflow at bytecode offset 26 of method _STM()' is wrong.</div><div><br></div><div>I have also compiled it fram java source:</div><div><div style="padding:0px 0px 0px 2px"><div style="color:rgb(0,0,0);font-family:Consolas;font-size:10pt;white-space:pre"><p style="margin:0px">  <span style="color:rgb(127,0,85);font-weight:bold">public</span> adHoc01_P_TXT2 _STM() {</p><p style="margin:0px">          <span style="color:rgb(63,127,95)">// JavaLine 45 <== SourceLine 6</span></p><p style="margin:0px">              <span style="font-style:italic">_ASGTXT</span>(<span style="color:rgb(0,0,192)">P_T</span>, <span style="font-style:italic">_ASGSTR</span>(<span style="color:rgb(127,0,85);font-weight:bold">new</span> adHoc01_P_TXT2((<span style="color:rgb(0,0,192);font-style:italic">_CUR</span>.<span style="color:rgb(0,0,192)">_SL</span>)).<span style="color:rgb(0,0,192)">_RESULT</span>, <span style="color:rgb(42,0,255)">"Abra"</span>)  );</p><p style="margin:0px">           EBLK();</p><p style="margin:0px">         <span style="color:rgb(127,0,85);font-weight:bold">return</span> (<span style="color:rgb(127,0,85);font-weight:bold">this</span>);</p><p style="margin:0px">  } <span style="color:rgb(63,127,95)">// End of Procedure BODY</span></p><p style="margin:0px"></p></div></div></div><div><br></div></div><div>Which compiles to the same byte-code. AND it executes correctly.</div><div>Is there something I'm not  seeing here ?</div><div><br></div><div>- Regards, Øystein Myhre Andersen</div><div><br></div><div><br></div><div> </div></div>