File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11
22
33foo fn(x:u32,y:u32) do
4+ print(x)
45 return y
56end
67
7- a=foo(55,44)
8- b=foo(66,77)
8+ foo(55,44)
9+ foo(66,77)
10+ foo(88,99)
Original file line number Diff line number Diff line change @@ -434,15 +434,15 @@ impl SlotManager {
434434 }
435435 }
436436
437- pub fn find_contiguous_slots ( & mut self , num : u8 ) -> u8 {
437+ pub fn find_contiguous_slots ( & mut self , existing_slots : & Vec < u8 > ) -> u8 {
438438 // Find the next unused slot (incrementally grow slot numbers)
439439
440440 for i in 0 ..255 {
441441 let mut counter = 0 ;
442- while !self . is_allocated ( i + counter) && counter < num {
442+ while !self . is_allocated ( i + counter) && counter < existing_slots . len ( ) as u8 {
443443 counter += 1 ;
444444 }
445- if counter == num {
445+ if counter == existing_slots . len ( ) as u8 {
446446 return i;
447447 }
448448 }
@@ -1294,7 +1294,7 @@ impl BytecodeGenerator<'_> {
12941294
12951295 // todo find a register to put the args into!!!
12961296
1297- let contiguous_slot = find_contiguous_slots ! ( self , arg_registers. len ( ) as u8 ) ;
1297+ let contiguous_slot = find_contiguous_slots ! ( self , & arg_registers) ;
12981298
12991299 let mut new_arg_registers: Vec < u8 > = vec ! [ ] ;
13001300 for i in 0 ..arg_registers. len ( ) {
You can’t perform that action at this time.
0 commit comments