ImHex icon indicating copy to clipboard operation
ImHex copied to clipboard

[Bug] Accessing member of this in a function cause exception

Open rsp4jack opened this issue 1 year ago • 0 comments

Operating System

Linux

What's the issue you encountered?


fn foo(ref Good go) {
    std::print(go.i);
};

struct Good {
    u8 i;
    foo(this);
};

Good good @ 0;

How can the issue be reproduced?

E: [ Stack Trace ]
E: <Source Code>:4:19 at address 0x0001
E: 4 |     std::print(go.i);
E:                       ^
E: <Source Code>:9:13 at address 0x0001
E: 9 |     foo(this);
E:                 ^
E: <Source Code>:7:8 at address 0x0000
E: 7 | struct Good {
E:            ^^^^
E: <Source Code>:1:7 at address 0x0000
E: 1 | using Good;
E:           ^^^^
E: <Source Code>:12:1 at address 0x0000
E: 12 | Good good @ 0;
E:      ^^^^
E: Error happened with cursor at address 0x0001

E: runtime error: No variable named 'i' found.
E:   -->   in <Source Code>:4:19
E: 4 |     std::print(go.i);
E:                       ^

ImHex Version

1.37.4

ImHex Build Type

  • [ ] Nightly or built from sources

Installation type

AppImage

Additional context?

IMO this.i is accessible at the invocation, so it should evals without problems.

rsp4jack avatar Apr 11 '25 14:04 rsp4jack