Hi, I have downloaded last MP 3.0 version and I am getting unexpected results using shr and shl operators. This sample program prints number 246, but I beleive that "123 shr 1" should be equivalent to "123 div 2".
I was expecting some bug, almost 650 downloads and not a single report on this release, too good to be true :p, but here it is… and now guys, THAT is a bug!
And yes, the operators are swapped when being written to the bytecode, in parser.c:4037 we can read:
A typo, or a copy/paste mistake, dunno, but for everyone reading this (and since I know there are some out there using the Artem's 007/009 command-line versions) I checked the code and this bug is present from the 007, so watch out! I will be fixing this but in the official 3.0 version only (the 007/009/009.SIMPLE will remain like they are in the SVN, just like Artem released them). If you want to fix this manually in your 007/009 local version just swap the switch options or the bytecode opcode and recompile it; and just in case check also you have fixed the real numbers parsing and the other bugs I already fixed -just compare your local version files against the MPC.3.0.IDE files in the SVN repository-.
Thanks for your report!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have downloaded last MP 3.0 version and I am getting unexpected results using shr and shl operators. This sample program prints number 246, but I beleive that "123 shr 1" should be equivalent to "123 div 2".
I was expecting some bug, almost 650 downloads and not a single report on this release, too good to be true :p, but here it is… and now guys, THAT is a bug!
And yes, the operators are swapped when being written to the bytecode, in parser.c:4037 we can read:
A typo, or a copy/paste mistake, dunno, but for everyone reading this (and since I know there are some out there using the Artem's 007/009 command-line versions) I checked the code and this bug is present from the 007, so watch out! I will be fixing this but in the official 3.0 version only (the 007/009/009.SIMPLE will remain like they are in the SVN, just like Artem released them). If you want to fix this manually in your 007/009 local version just swap the switch options or the bytecode opcode and recompile it; and just in case check also you have fixed the real numbers parsing and the other bugs I already fixed -just compare your local version files against the MPC.3.0.IDE files in the SVN repository-.
Thanks for your report!