Keep -vet happy

This commit is contained in:
gingerBill
2026-07-14 13:28:12 +01:00
parent ee21677ac7
commit 8b7d1be601
3 changed files with 5 additions and 6 deletions

View File

@@ -170,7 +170,7 @@ decode_one :: proc(
default_index := len(operands)
reserve(&operands, count+1)
append(&operands, Operand{}) // dummy for default
for i in 0 ..< int(count) {
for _ in 0..<int(count) {
t := read_uleb(data, &off) or_return
append(&operands, op_labelidx(u32(t)))
}

View File

@@ -280,7 +280,7 @@ wat_write_function :: proc(sb: ^strings.Builder, m: Module, func_relocs: []Reloc
assert(len(f.blocks) <= 1)
for blk in f.blocks {
level := 0
for &op, i in blk.ops {
for &op in blk.ops {
opcode := Opcode(op.opcode)
#partial switch opcode {
case .END, .ELSE:

View File

@@ -109,7 +109,6 @@ emit_passthrough :: proc(m: Module, out: ^[dynamic]u8, relocs: ^[dynamic]Relocat
// From-scratch module: synthesize the modeled sections in canonical order.
@(private)
emit_synth :: proc(m: Module, out: ^[dynamic]u8, relocs: ^[dynamic]Relocation, errors: ^[dynamic]Error) {
// id byte ++ uleb(len contents) ++ contents
emit_section :: proc(out: ^[dynamic]u8, id: Section_Id, contents: []u8) {
append(out, u8(id))
append_uleb(out, u64(len(contents)))
@@ -124,7 +123,7 @@ emit_synth :: proc(m: Module, out: ^[dynamic]u8, relocs: ^[dynamic]Relocation, e
c: [dynamic]u8; c.allocator = tmp
append_uleb(&c, u64(len(m.func_types)))
for ft in m.func_types {
append(&c, 0x60) // functype form
append(&c, 0x60) // functype form
#assert(size_of(ft.params[0]) == 1)
#assert(size_of(ft.results[0]) == 1)
@@ -285,7 +284,7 @@ emit_code_section :: proc(m: Module, out: ^[dynamic]u8, relocs: ^[dynamic]Reloca
@(private)
emit_locals :: proc(body: ^[dynamic]u8, locals: []Value_Type) {
group_count := u32(0)
for i := 0; i < len(locals); /**/ {
#no_bounds_check for i := 0; i < len(locals); /**/ {
j := i+1
for j < len(locals) && locals[j] == locals[i] {
j += 1
@@ -294,7 +293,7 @@ emit_locals :: proc(body: ^[dynamic]u8, locals: []Value_Type) {
i = j
}
append_uleb(body, u64(group_count))
for i := 0; i < len(locals); /**/ {
#no_bounds_check for i := 0; i < len(locals); /**/ {
j := i+1
for j < len(locals) && locals[j] == locals[i] {
j += 1