Skip to content

[BUG] - Casting between integer sizes #140

@Jamesbarford

Description

@Jamesbarford

Describe the bug
Sometimes casting between I32's and I64's can explode. Or give a very wrong number.

To Reproduce
This might have been fixed so is difficult/impossible to reproduce. Typically it occurs when a function argument is a different integer size from the integer being passed into the called function.

Example Program

U0 PrintInt(U16 x)
{
  "%d\n";
}

U0 Main()
{
  I64 d = 34;
  PrintInt(d); // prints an extremely large negative number
}

Expected behavior
A C-like integer conversion should happen. This is a bit vague but boils down to "do what C does" which then leads to C-like behaviour than something completely unexpected which is what happens now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions