WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
43.98k stars 1.92k forks source link

[Bug] Passing a (placed) struct as non-type template parameter makes it disappear #1642

Open Calcoph opened 5 months ago

Calcoph commented 5 months ago

Operating System

Windows

What's the issue you encountered?

When passing structs that have been placed as non-type template parameter, they no longer render in the hex-edoitor or pattern data. This doesn't happen with built in types (like u32), but it does with structs.

How can the issue be reproduced?

struct A {
    u8 field1;
};

struct B<auto S> {
    u8 arr[S.field1];
};

A a @ 0x00;
B<a> b @ 0x01;

a doesn't get rendered.

struct B<auto S> {
    u8 arr[S.field1];
};

u32 a @ 0x00;
B<a> b @ 0x01;

a gets rendered.

ImHex Version

1.33.0 a7033b6

ImHex Build Type

Installation type

MSI

Additional context?

No response

paxcut commented 5 months ago

This looks a lot like #1628. Maybe they are related.

Calcoph commented 5 months ago

This looks a lot like #1628. Maybe they are related.

Seems to be the case.

If I do instead:

struct A {
    u8 field1;
};

struct B<auto S> {
    u8 arr[S];
};

A a @ 0x00;
B<a.field1> b @ 0x01;

neither a, nor a.field1 disappears.

By doing:

struct C {
    u8 field2;
};

struct A {
    u8 field1;
    C fieldC;
};

struct B<auto S> {
    u8 arr[S.field2];
};

A a @ 0x00;
B<a.fieldC> b @ 0x02;

a.fieldC disappears but a.field1 doesn't, like in that issue.