checker: disallow implicit conversion from fixed array to fooptr (#8823)

This commit is contained in:
Nick Treleaven 2021-02-25 23:28:47 +00:00 committed by GitHub
parent 639061be6c
commit c03798e390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 18 deletions

View file

@ -147,9 +147,13 @@ pub fn (n Number) str() string {
// .hexstr returns a hexadecimal representation of the bignum `n`
pub fn (n Number) hexstr() string {
mut buf := [8192]byte{}
// NB: C.bignum_to_string(), returns the HEXADECIMAL representation of the bignum n
C.bignum_to_string(&n, buf, 8192)
s := unsafe { tos_clone(buf) }
mut s := ''
unsafe {
bp := &buf[0]
// NB: C.bignum_to_string(), returns the HEXADECIMAL representation of the bignum n
C.bignum_to_string(&n, bp, 8192)
s = tos_clone(bp)
}
if s.len == 0 {
return '0'
}