Skip to content

Commit

Permalink
Fix ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed Jul 28, 2024
1 parent e5f458c commit e65deb8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/builtins/builtins.zig
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ fn String_decode2(vm: *cy.VM) Value {
fn arrayIndex(vm: *cy.VM) anyerror!Value {
const arr = vm.getObject(*cy.heap.Array, 0);
const elem_t: cy.TypeId = @intCast(vm.getInt(1));
const idx = try intAsIndex(vm.getInt(2), arr.len);
const idx = try intAsIndex(vm.getInt(2), @intCast(arr.len));

const elems = arr.getElemsPtr();
if (vm.sema.isUnboxedType(elem_t)) {
Expand Down Expand Up @@ -952,7 +952,7 @@ fn String_getInt32(vm: *cy.VM) anyerror!Value {
fn stringFindAnyByte(vm: *cy.VM) Value {
const slice = vm.getString(0);
const set_slice = vm.getObject(*cy.heap.Object, 1);
const set_ptr: [*]u8 = @ptrFromInt(set_slice.getValue(0).val);
const set_ptr: [*]u8 = @ptrFromInt(@as(usize, @intCast(set_slice.getValue(0).val)));
const set_len: usize = @intCast(set_slice.getValue(1).asInt());
const set = set_ptr[0..set_len];
const setIsAscii = cy.string.isAstring(set);
Expand Down
4 changes: 2 additions & 2 deletions src/heap.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2095,13 +2095,13 @@ pub fn freeObject(vm: *cy.VM, obj: *HeapObject, comptime skip_cyc_children: bool
}
},
.array => {
for (obj.array.getElemsPtr()[0..obj.array.len]) |it| {
for (obj.array.getElemsPtr()[0..@intCast(obj.array.len)]) |it| {
if (skip_cyc_children and it.isCycPointer()) {
continue;
}
cy.arc.release(vm, it);
}
freeExternalObject(vm, obj, (2 + obj.array.len) * @sizeOf(Value), true);
freeExternalObject(vm, obj, @intCast((2 + obj.array.len) * @sizeOf(Value)), true);
},
.trait => {
const impl = obj.trait.impl;
Expand Down
2 changes: 1 addition & 1 deletion src/sym.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ test "sym internals" {
} else {
if (cy.is32Bit) {
try t.eq(@sizeOf(Sym), 16);
try t.eq(@sizeOf(Func), 40);
try t.eq(@sizeOf(Func), 44);
} else {
try t.eq(@sizeOf(Sym), 24);
try t.eq(@sizeOf(Func), 72);
Expand Down
4 changes: 3 additions & 1 deletion src/vm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pub const VM = struct {
stdHttpClient: if (cy.hasCLI) *http.StdHttpClient else *anyopaque,

emptyString: Value,
placeholder: Value,

varSymExtras: cy.List(*cy.Sym),

Expand Down Expand Up @@ -234,6 +235,7 @@ pub const VM = struct {
.compiler = undefined,
.sema = undefined,
.emptyString = undefined,
.placeholder = undefined,
.strInterns = .{},
.staticObjects = .{},
.names = .{},
Expand Down Expand Up @@ -3463,7 +3465,7 @@ pub const VMGetArgExt = struct {

pub fn getArrayElems(vm: *VM, idx: u32) []Value {
const arr = vm.c.framePtr[CallArgStart + idx].castHeapObject(*cy.heap.Array);
return arr.getElemsPtr()[0..arr.len];
return arr.getElemsPtr()[0..@intCast(arr.len)];
}

pub fn getEnumValue(vm: *VM, idx: u32) u32 {
Expand Down

0 comments on commit e65deb8

Please sign in to comment.