Skip to content

PrintF is likely broken on x86 #485

@ForNeVeR

Description

@ForNeVeR

See this code:

nint pointerValue = ((nint*)varargs)[consumedArgs];
string pointerValueString = pointerValue.ToString("X");
streamWriter.Write(pointerValueString);
consumedBytes += pointerValueString.Length;
consumedArgs++;
break;
case "x":
case "X":
nuint hexadecimalValue = ((nuint*)varargs)[consumedArgs];

varargs is casted to a pointer to nint or nuint.

These types have different sizes on different platforms, while our current vararg convention is that we pass an array of 8-byte-sized items (doubles, longs or pointers).

We should also figure out whether it's currently called correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:stdlibC standard library implementationkind:bugSomething isn't workingstatus:help-wantedOpen for contributors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions