derickr / vld

BSD 2-Clause "Simplified" License
464 stars 87 forks source link

the instruction of vld is not correct for php7.4.0 #50

Closed jimmyleeeeee closed 4 years ago

jimmyleeeeee commented 4 years ago

When I use php 7.4.0 and vld to generate the opcode, the opcode is not correct. The php code is below: $a=1; $b=1; echo $a!=$b; echo $a<$b; echo $a<=$b;

I get the opcode below: line #* E I O op fetch ext return operands

2 0 ASSIGN !0, 1 3 1 ASSIGN !1, 1 5 2 IS_SMALLER ~4 !0, !1 3 ECHO ~4 6 4 IS_SMALLER_OR_EQUAL ~5 !0, !1 5 ECHO ~5 7 6 CAST 0 ~6 !0, !1 7 ECHO ~6 35 8* RETURN 1

It seems that the opcode is not correct. != is translated to IS_SMALLER. <is translated to IS_SMALLER_OR_EQUAL. <= is translated to CAST.

jimmyleeeeee commented 4 years ago

I have resolved this issue, may I submit the code?

derickr commented 4 years ago

You don't need to ask to submit a Pull Request, just do it! We can then argue about whether it is right or not :-)

jimmyleeeeee commented 4 years ago

I don't have the privilege to submit a Pull Request. Can you open it to me?

derickr commented 4 years ago

Everybody has that privilege, it comes with GitHub. But you need to do it from your own fork (see top-right button).

jimmyleeeeee commented 4 years ago

I am sorry. I don't often use github. Thanks for your guide. I have learnt it and tried to add a pull request. Please review whether the change is OK.

jimmyleeeeee commented 4 years ago

I have create a pull request, please review whether the change is OK.

jimmyleeeeee commented 4 years ago

The issue has been resolved.

jimmyleeeeee commented 4 years ago

As the code is noe merged to master branch, I reopen this issue.

derickr commented 4 years ago

Thanks, this has been fixed through #55 (by you :-) ), and it's now merged.