eo icon indicating copy to clipboard operation
eo copied to clipboard

As-bytes conversion to EO, does it work?

Open MikhailLipanin opened this issue 1 year ago • 2 comments

I have a simple program:

[] > app
  QQ.io.stdout > @
    QQ.txt.sprintf "result is %d\n"
      -1.times 228

I covert it to xmir using Syntax.java, and I get:

<objects>
   <o abstract="" name="app" pos="0">
      <o base=".stdout" name="@">
         <o base=".io" >
            <o base="QQ"/>
         </o>
         <o base=".sprintf">
            <o base=".txt" >
               <o base="QQ"/>
            </o>
            <o base="string" data="string">result is %d\n</o>
            <o base=".times">
               <o base="int" data="bytes">FF FF FF FF FF FF FF FF</o>
               <o base="int" data="bytes">00 00 00 00 00 00 00 E4</o>
            </o>
         </o>
      </o>
   </o>
</objects>

After that I convert it Again to eo via XMIR.java and I get the strange result instead of -1:

[] > app
  QQ
  .io
  .stdout > @
    QQ
    .txt
    .sprintf
      "result is %d\n"
      18446744073709551615
      .times
        228

MikhailLipanin avatar Sep 19 '22 15:09 MikhailLipanin

@MikhailLipanin I think it's a bug in XMIR class. @Graur can you please take a look?

yegor256 avatar Sep 19 '22 18:09 yegor256

@yegor256 Sure, I will check it

Graur avatar Sep 19 '22 18:09 Graur

@Graur, Can you fix this one? Because of this, I can't run this test. There is -1.times x

MikhailLipanin avatar Oct 26 '22 13:10 MikhailLipanin

@Graur any updates here?

yegor256 avatar Mar 05 '23 05:03 yegor256

@MikhailLipanin @yegor256 I added test from the issue and XMIRTest.java test passed. This test compare two EO files before and after converting it to XMIR and back to EO. You can check it here: #2083.

Graur avatar May 23 '23 18:05 Graur