Formatter: keep disp_padding preset when set to PADDING_AUTO#617
Formatter: keep disp_padding preset when set to PADDING_AUTO#617dxbjavid wants to merge 1 commit into
Conversation
|
It should be noted that For Unless I'm misunderstanding the intent here, both cases of "resolve using style preset" are unintended leftovers and should be removed. |
7113cfc to
952d405
Compare
|
You're right, the preset resolution was a leftover in both. Reworked it: DISP_PADDING no longer special-cases AUTO at all, so passing it now gets rejected like any other out-of-range value (matches the docs, and the disp printer doesn't understand AUTO anyway). IMM_PADDING keeps AUTO but just passes it straight through to the field the same way ADDR_PADDING_* already do, since ZydisFormatterBasePrintIMM resolves it. Regression suite still passes. |
A DISP_PADDING of ZYDIS_PADDING_AUTO is resolved to the style preset in ZydisFormatterSetProperty, then immediately overwritten by the unconditional disp_padding = value, so it stays at -1. The AT&T/Intel displacement printers pass disp_padding straight to the number formatter with no AUTO handling (unlike imm/addr), so SetProperty returns SUCCESS but every later format of a memory operand with a displacement fails with INSUFFICIENT_BUFFER_SIZE. Move the assignment into an else.