StorePointer writes ptr to the target pointer index. Pointers are stored in a separate address space and can only be loaded using PointerIndex values.
(idx value.PointerIndex, ptr value.Pointer)
| 449 | // Pointers are stored in a separate address space and can only be loaded using |
| 450 | // PointerIndex values. |
| 451 | func (b *Builder) StorePointer(idx value.PointerIndex, ptr value.Pointer) { |
| 452 | b.instructions = append(b.instructions, |
| 453 | asm.Push{Value: ptr}, |
| 454 | asm.Store{Destination: idx}, |
| 455 | ) |
| 456 | rng := memory.Range{ |
| 457 | Base: uint64(idx) * uint64(b.memoryLayout.GetPointer().GetSize()), |
| 458 | Size: uint64(b.memoryLayout.GetPointer().GetSize()), |
| 459 | } |
| 460 | interval.Merge(&b.pointerMemory, rng.Span(), true) |
| 461 | } |
| 462 | |
| 463 | // Strcpy pops the source address then the target address from the top of the |
| 464 | // stack, and then copies at most maxCount-1 bytes from source to target. If |