Em sex., 12 de ago. de 2022 às 09:26, Paul Cercueil
<paul@crapouillou.net> escreveu:
[...]
>> Actually that case would be fine. It's for the case where the
LABEL
>> is
>> between the ldr_ui and the bswapr_ui. I do check the previous
>> opcode,
>> because that's where the jit_flag_patch seems to be.
>
> I see. The logic is just checking if the previous node is a
label
> or an
> epilog implicit patch.
Actually it looks like the detection code is broken. With the
example
code of my previous email, if I add a jit_label() between the
jit_ldr_ui() and the jit_bswapr_ui(), it still converts to the LWBRX
opcode and Lightning eventually fails an assert() in jit_address().
It should not fail if you use jit_indirect() instead of
jit_label(). Using
jit_label() is subject to optimization, if there is no jump to it. The
assertion is because the label is not used.