Skip to content

Commit

Permalink
Fix failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcarreiro committed Mar 8, 2024
1 parent 8f2043d commit c49ddbe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions yarn-project/simulator/src/avm/avm_memory_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export enum TypeTag {

// TODO: Consider automatic conversion when getting undefined values.
export class TaggedMemory {
private log: DebugLogger = createDebugLogger('aztec:avm_simulator:memory');
static readonly log: DebugLogger = createDebugLogger('aztec:avm_simulator:memory');

// FIXME: memory should be 2^32, but TS doesn't allow for arrays that big.
static readonly MAX_MEMORY_SIZE = Number((1n << 32n) - 2n);
Expand All @@ -214,15 +214,15 @@ export class TaggedMemory {
public getAs<T>(offset: number): T {
assert(offset < TaggedMemory.MAX_MEMORY_SIZE);
const word = this._mem[offset];
this.log(`get(${offset}) = ${word}`);
TaggedMemory.log(`get(${offset}) = ${word}`);
return word as T;
}

public getSlice(offset: number, size: number): MemoryValue[] {
assert(offset < TaggedMemory.MAX_MEMORY_SIZE);
assert(offset + size < TaggedMemory.MAX_MEMORY_SIZE);
const value = this._mem.slice(offset, offset + size);
this.log(`getSlice(${offset}, ${size}) = ${value}`);
TaggedMemory.log(`getSlice(${offset}, ${size}) = ${value}`);
return value;
}

Expand All @@ -241,7 +241,7 @@ export class TaggedMemory {
public set(offset: number, v: MemoryValue) {
assert(offset < TaggedMemory.MAX_MEMORY_SIZE);
this._mem[offset] = v;
this.log(`set(${offset}, ${v})`);
TaggedMemory.log(`set(${offset}, ${v})`);
}

public setSlice(offset: number, vs: MemoryValue[]) {
Expand All @@ -252,7 +252,7 @@ export class TaggedMemory {
this._mem.length = offset + vs.length;
}
this._mem.splice(offset, vs.length, ...vs);
this.log(`setSlice(${offset}, ${vs})`);
TaggedMemory.log(`setSlice(${offset}, ${vs})`);
}

public getTag(offset: number): TypeTag {
Expand Down

0 comments on commit c49ddbe

Please sign in to comment.