Skip to content

[16-bit AVR] Builtin.IntLiteral has limited bits #75652

Open
@benrimmington

Description

@benrimmington

Builtin.IntLiteral for 16-bit AVR has a maximum bitWidth of 255, unless the IntegerLiteralFlags::BitWidthShift is changed. ConstantIntegerLiteralMap::get() will build the flags word, without checking if the bitWidth was truncated.

let value = StaticBigInt(
  0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
)
value.bitWidth  //-> expected: 256 or 0x100, actual: 0

(StaticBigInt isn't part of the embedded Swift stdlib.)

Cc: @carlos4242 @kubamracek @phausler @rauhul

Metadata

Metadata

Assignees

No one assigned

    Labels

    embeddedEmbedded Swiftinteger literalsFeature → literals: Integer literals

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions