-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #15730 cstring nil semantics in VM now work like in RT #16026
fix #15730 cstring nil semantics in VM now work like in RT #16026
Conversation
@@ -1035,7 +1035,13 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = | |||
regs[ra].intVal = not regs[rb].intVal | |||
of opcEqStr: | |||
decodeBC(rkInt) | |||
regs[ra].intVal = ord(regs[rb].node.strVal == regs[rc].node.strVal) | |||
var ret = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cstring and string share many magic functions implementations in vmgen: mAppendStrStr, mLengthStr, mSlice.
All these functions now need to handle null as a value.
It would be more efficient to generate different code in vmgen to avoid if statements in vm rawExecute which is important to be fast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely it means that cstring and string need to get different op codes opcEqStr
, opcEqCStr
, opcLenStr
and opcLenCStr
and etc
We need this PR to make this issue work timotheecour#6 (comment) The default value of |
2fadb6c
to
60c9eae
Compare
bf25524
to
f6bb05f
Compare
This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions. |
fix #15730