-
Notifications
You must be signed in to change notification settings - Fork 744
Remove casts to size_t in Rust code #4
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
Comments
This depends on rust-lang/rust#28779. That was merged to the Rust beta branch in rust-lang/rust#29112 so we can probably do this soon. |
Fixed in 377f611 by dropping the dependency on the libc crate and defining our own |
Closed
backwardn
pushed a commit
to backwardn/ring
that referenced
this issue
Nov 20, 2019
Fix generateMultiHash write data to source data slice
briansmith
added a commit
that referenced
this issue
Apr 8, 2025
This changes the codegen for places where we call `cpu::features()` as expected. Examples: ``` adrp x8, :got:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E mov x19, x0 ldr x8, [x8, :got_lo12:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E] - ldar x8, [x8] + ldr x8, [x8] cbz x8, .LBB86_2 ``` ``` adrp x8, :got:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E mov x19, x4 mov x20, x3 ldr x8, [x8, :got_lo12:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E] mov x21, x2 mov x22, x0 sub x23, x3, #4 - ldar x8, [x8] + ldr x8, [x8] cbz x8, .LBB84_8 ```
briansmith
added a commit
that referenced
this issue
Apr 10, 2025
This changes the codegen for places where we call `cpu::features()` as expected. Examples: ``` adrp x8, :got:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E mov x19, x0 ldr x8, [x8, :got_lo12:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E] - ldar x8, [x8] + ldr x8, [x8] cbz x8, .LBB86_2 ``` ``` adrp x8, :got:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E mov x19, x4 mov x20, x3 ldr x8, [x8, :got_lo12:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E] mov x21, x2 mov x22, x0 sub x23, x3, #4 - ldar x8, [x8] + ldr x8, [x8] cbz x8, .LBB84_8 ```
briansmith
added a commit
that referenced
this issue
Apr 10, 2025
This changes the codegen for places where we call `cpu::features()` as expected. Examples: ``` adrp x8, :got:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E mov x19, x0 ldr x8, [x8, :got_lo12:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E] - ldar x8, [x8] + ldr x8, [x8] cbz x8, .LBB86_2 ``` ``` adrp x8, :got:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E mov x19, x4 mov x20, x3 ldr x8, [x8, :got_lo12:_ZN4ring3cpu3arm12featureflags8FEATURES17habb4a2487137fb15E] mov x21, x2 mov x22, x0 sub x23, x3, #4 - ldar x8, [x8] + ldr x8, [x8] cbz x8, .LBB84_8 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See rust-lang/rust/#28096.
There are some casts like
digest.len() as libc::size_t
that are potentially truncating and thus unsafe. At the same time, the comments in the code questioning the safety of such casts need to be removed.This will have to wait for a higher-versioned released of the libc crate with rust-lang/rust#28096 merged into it.
The text was updated successfully, but these errors were encountered: