benilla-re systems structs docs

s_vsnoprintfReadCases

global · storm

Address
0x669a80 · 16 bytes, up to 0x669a8f
Type
void *[4]
Meaning
Holds the four cases that read an argument by kind in 0x6697d0's second pass
Confidence
verified, proof one
Finding
storm/printf#ordered-conversions

Finding: Ordered conversions in storm: printf

vsnoprintf(dest, size, fmt, va) makes three passes. The first records each % spec and, for one taking an argument, stores its kind at its index: N − 1 after %N$, else one past the previous spec's, so a plain spec after %2$s reads argument 3. The last spec naming an index decides its kind. The second reads the arguments from index 0 to the highest named, by kind: 4 bytes for an integer or a pointer, 8 for a long long or a double, 4 for an index no spec names. The third copies the text and hands each spec to _snprintf with its argument, so a repeated index prints one value twice.

The derivation is in the doc.