Skip to content

Diagnostic has missing argument causing an assert #7425

@tcorringham

Description

@tcorringham
Collaborator

Description
A diagnostic is generated for an integer literal that is too large to be represented by any integer type - an argument indicates whether the text contains "signed".
That argument was missing in two instances of the diagnostic in HLSL specific code within Sema::ActOnNumericConstant(), which results in an assert being raised if the diagnostic is generated in an assert enabled DXC, or a random(ish) value being used as the argument in a non-assert DXC.

Steps to Reproduce
Any use of a too large integer literal will reproduce the issue, e.g. compiling the single line below with -T lib_6_6

int a = 98765432109876543210U;

Actual Behavior
In an assert DXC:
Error: assert(Idx < getNumArgs() && "Argument index out of range!"))
In a non-assert DXC-build:
error: integer literal is too large to be represented in any 6531711741328785130integer type

Environment

  • DXC version - Any, e.g. libdxcompiler.so: 1.9(dev;1-9536291d); libdxil.so: 1.9
  • Host Operating System - Any and all

Activity

self-assigned this
on May 3, 2025
added a commit that references this issue on May 3, 2025
040fc53
added a commit that references this issue on Jun 20, 2025
b78ac50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashneeds-triageAwaiting triage

Type

No type

Projects

Status

Triaged

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @tcorringham

    Issue actions

      Diagnostic has missing argument causing an assert · Issue #7425 · microsoft/DirectXShaderCompiler