-
Notifications
You must be signed in to change notification settings - Fork 11
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
Replace unsafeAddr by baseAddr #32
Conversation
hm, I'm not convinced The alternative solution here might be to avoid |
@@ -335,7 +335,7 @@ template writeByte*(span: var PageSpan, val: byte) = | |||
|
|||
template charsToBytes*(chars: openArray[char]): untyped = |
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.
charsToBytes should call https://github.com/nim-lang/Nim/blob/version-1-2/lib/system.nim#L2981 instead
should also add a test for writing/finalizing with empty array |
@@ -335,7 +335,7 @@ template writeByte*(span: var PageSpan, val: byte) = | |||
|
|||
template charsToBytes*(chars: openArray[char]): untyped = | |||
bind makeOpenArray | |||
var charsStart = unsafeAddr chars[0] |
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.
baseAddr
has been fixed to return ptr T
(so the ptr byte
cast is no longer necessary) and to return nil when the source is empty, so this code will now be as safe as it gets
devel failure unrelated cc @zah |
where is nim-1.6.10 |
it's part of |
really? it seems all the status-im packages my project relys has no tag, so no version restrictions, I also checked nimble packages dir, all of them match the latest version declared in nimble file. it seems template symbol resolution problem to me. |
hmm, you're right, when not versioned nimble not trying getting the latest. |
It should fix some of the https://github.com/status-im/nim-protobuf-serialization CI problems.
The rest of the problems should be solved with #31