We were hitting a CIR verification error in some cases when a boolean expression was used as an index to an array because the GetElementOp verifier expected the index operand to be a fundamental integer type. To fix this, I'm updating the emitArraySubscriptExpr to cast index values to ptrDiffTy, which more closely matches what classic codegen does in the corrsponding code. The improved alignment with the classic codegen implementation caused some minor changes in generated IR that required some tests to be updated. Assisted-by: Cursor / claude-4.7-opus-high
30 KiB
30 KiB