Pure XOJO code works differently for MacOS intel / arm

I was totally wrong - the TCPSocket is behaving normally on ARM.

What is different? The FTP server is sending back different responses. Why? because the FTP client is sending different commands on Intel vs. ARM.

Why is this happening? Looks like there’s a bug in ARM with popping a Structure.

This code is not behaving the same on Intel and ARM:

If Not TransferInProgress And UBound(PendingVerbs) > -1 Then
  Dim nextverb As FTPVerb = PendingVerbs.Pop

Note that FTPVerb is a Structure and I suspect that’s important.

Here is what happens step-by-step on ARM:

First, notice that there are two FTPVerbs in the array. These are correct:

Next, we step through the command:
Dim nextverb As FTPVerb = PendingVerbs.Pop

And now there is only one item in the array, as expected. Item 1 was popped, leaving item 0.

What is the value of the nextVerb variable? It should be equal to the item that was popped “PASS Password”.

But it’s not:

I’ve seen some cases where adding extra logging to the app fixes the bug, so I think it’s some sort of compiler bug.

I’ll see if I can isolate it to a test case and report it as an Issue.

7 Likes