fix a few small bugs
authorcassowarii <cassowary@cassowary.me>
Mon, 6 Jul 2026 17:53:45 +0000 (10:53 -0700)
committercassowarii <cassowary@cassowary.me>
Mon, 6 Jul 2026 17:53:45 +0000 (10:53 -0700)
src/compile/ir.c
src/data/methods.c
src/vm/exec.c

index 2a995a6..fb20c2d 100644 (file)
@@ -587,7 +587,7 @@ static void compile_ast_stmtseq(hIrChunk ck, sbAst seqast, flag implicit_return)
 
   /* now reset the 'introduced' flag of anything that was introduced by LET so
    * that we can't refer to them earlier than they are declared */
-  BUFFER_ITER_FROM(ck->program->varmapping, varmapentry, entry, ck->lowest_var_id) {
+  BUFFER_ITER_FROM(ck->program->varmapping, varmapentry, entry, lowest_var) {
     if (entry->var->introduced == BY_LET) {
       entry->var->introduced = NOT_INTRODUCED;
     }
index 9194a74..a8011f1 100644 (file)
@@ -31,7 +31,7 @@ void sbList_method(hVm vm) {
       sbVm_call_c_func(vm, list_each_cfunc);
     }
   } else {
-    PANIC("method name to list is not symbol! (%ld)", method_name_val->type);
+    PANIC("method name to list is not symbol! (%lld)", (long long)method_name_val->type);
   }
 }
 
index 9a85acb..ee48f62 100644 (file)
@@ -12,7 +12,7 @@ void push_stack(hVm vm, hV *value);
 void push_stack_immediate(hVm vm, const hV *value);
 hV *pop_stack(hVm vm);
 hV *npop_stack(hVm vm, usize count);
-hV *peek_stack(hVm vm, usize offset);
+hV *peek_stack(hVm vm, isize offset);
 void print_stack(hVm vm);
 
 void sbVm_initialize(hVm vm, usize stacksize, usize rstacksize, flag debugmode) {
@@ -215,7 +215,7 @@ void swap_stack_top(hVm vm) {
   *second_x = xtmp;
 }
 
-hV *peek_stack(hVm vm, usize offset) {
+hV *peek_stack(hVm vm, isize offset) {
   return ((hV**)(vm->vsp))[-offset - 1];
 }