Files
Alessandro Di Federico 6175c43b0c Lift: zero initialize temporaries
Sometimes QEMU will emit code that reads a local temporary *before* it
is assigned in the `TranslationBlock`. This usually happens when lifting
non-code, but it's still a problem since it leads to phis around the
dispatcher, which we don't want.

For example, consider the following x86-64 code:

```
0000000140002000 <.text>:
140002000: f0    lock
140002001: 38 00 cmpb    %al, (%rax)
```

It leads to:

```
[libtcg] Translation starting from 0x140002000:Generic64
[libtcg]   ---- 0000000040002000
[libtcg]     mov_i64 loc2,rax
[libtcg]     mov_i64 loc1,rax
[libtcg]     mov_i64 cc_src,loc1
[libtcg]     mov_i64 loc8,loc0
[libtcg]     sub_i64 cc_dst,loc0,loc1
[libtcg]     discard cc_src2
[libtcg]     discard cc_op
```

Note how `loc0` is read before being initialized.

Currently we zero-initialize all the temporaries. It would be in
princple possible to detect those that need the initialization, which
would also enable us to emit a warning.
2025-12-16 17:42:07 +01:00
..
2025-10-31 17:25:03 +01:00
2025-10-31 17:25:03 +01:00
2024-10-10 14:50:26 +02:00