Skip to content

Commit 8c6951a

Browse files
committed
all: fix CI issues with auto-deref vars, sha512 stack alloc, and Vinix build
1 parent a9983eb commit 8c6951a

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

vlib/crypto/sha512/sha512block_generic.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const _k = [
3838
fn block_generic(mut dig Digest, p_ []u8) {
3939
unsafe {
4040
mut p := p_
41-
mut w := []u64{len: (80)}
41+
mut w := [80]u64{}
4242
mut h0 := dig.h[0]
4343
mut h1 := dig.h[1]
4444
mut h2 := dig.h[2]

vlib/v/checker/checker.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6514,6 +6514,9 @@ fn (mut c Checker) prefix_expr(mut node ast.PrefixExpr) ast.Type {
65146514
if right_type.is_ptr() {
65156515
return right_type.deref()
65166516
}
6517+
if expr.is_auto_deref_var() {
6518+
return right_type
6519+
}
65176520
if !right_type.is_pointer() && !c.pref.translated && !c.file.is_translated {
65186521
s := c.table.type_to_str(right_type)
65196522
c.error('invalid indirect of `${s}`, the type `${right_sym.name}` is not a pointer',

vlib/v/gen/c/assign.v

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,11 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) {
11071107
if left_sym.kind == .function {
11081108
g.write('{void* _ = ')
11091109
} else {
1110-
g.write('{${styp} _ = ')
1110+
mut actual_styp := styp
1111+
if val is ast.Ident && val.is_auto_deref_var() {
1112+
actual_styp = '${styp}*'
1113+
}
1114+
g.write('{${actual_styp} _ = ')
11111115
}
11121116
if (val in [ast.MatchExpr, ast.IfExpr, ast.ComptimeSelector] || is_fixed_array_var)
11131117
&& unaliased_right_sym.info is ast.ArrayFixed {

0 commit comments

Comments
 (0)