mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG] Pointer is not working properly

Open a62690705 opened this issue 10 months ago • 0 comments

Bug description

def main():
    var v = 8
    var ptr = Pointer[Int](v)

    print(ptr)


Output

0x8

The location of the variable v was supposed to be printed in memory as 0x8ffed2bfe0b0, but it did not happen.

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ?     https://docs.modular.com/mojo/playground
- Provide version information for Mojo by pasting the output of `mojo -v`   24.2
- Provide Modular CLI version by pasting the output of `modular -v`

a62690705 avatar Apr 07 '24 11:04 a62690705