Skip to content

Commit

Permalink
Fix memory relocation fn usage
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbosio committed Jul 31, 2023
1 parent f17c2b4 commit 3ad79d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/vm/memory/relocatable.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewMaybeRelocatableRelocatable(segmentIndex int, offset uint) *MaybeRelocat
}

// TODO: Return value should be of type (felt, error)
func (m *MaybeRelocatable) RelocateValue(relocationTable []uint) (int, error) {
func (m *MaybeRelocatable) RelocateValue(relocationTable *[]uint) (int, error) {
inner_int, ok := m.GetInt()
if ok {
return int(inner_int.felt), nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm/runners/cairo_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewCairoRunner() *CairoRunner {
return &CairoRunner{RelocatedMemory: make([]int, 0)}
}

func (c *CairoRunner) RelocateMemory(vm *vm.VirtualMachine, relocationTable []uint) error {
func (c *CairoRunner) RelocateMemory(vm *vm.VirtualMachine, relocationTable *[]uint) error {
if len(c.RelocatedMemory) != 0 {
return errors.New("Inconsistent relocation")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm/runners/cairo_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestRelocateMemory(t *testing.T) {
t.Errorf("Could not create relocation table")
}

err := runner.RelocateMemory(virtualMachine, relocationTable)
err := runner.RelocateMemory(virtualMachine, &relocationTable)
if err != nil {
t.Errorf("Test failed with error: %s", err)
}
Expand Down

0 comments on commit 3ad79d4

Please sign in to comment.