[EXT_EP-9381] Pointer to VLA 2D array computation in IF condition is double-adjusted and garbled Created: 24/May/19  Updated: 19/Feb/20  Resolved: 24/May/19

Status: Fixed
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: TI User Assignee: TI User
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-6289
Forum URL: https://e2e.ti.com/support/tools/ccs/f/81/t/803569
Found In Release: C2000_20.2.0.beta
C6000_8.2.0
C2000_18.1.0.LTS
C6000_8.3.0
ARM_18.12.0.LTS
PRU_2.3.0
C7000_1.2.0.STS
ARM_18.1.0.LTS
MSP430_18.1.0.LTS
PRU_2.4.0*
MSP430_18.12.0.LTS
ARM_20.2.0.beta
C2000_18.12.0.LTS
MSP430_20.2.0.beta
Fix In Release: C2000_20.2.0.beta
C2000_18.1.7.LTS
ARM_18.12.3.LTS
ARM_18.1.7.LTS
MSP430_18.12.3.LTS
C2000_18.12.3.LTS
C7000_1.2.0.STS
PRU_2.3.3
PRU_2.4.0*
MSP430_18.1.7.LTS
C6000_8.3.5
C6000_8.2.8
ARM_20.2.0.beta
MSP430_20.2.0.beta
Affected Platform/Device: default
Workaround: Given "if (p[i][j])", moving the access into a temp with "T = p[i][j]; if (T)" is the simplest workaround. Since the bug happens early in compilation, optimisation level doesn't matter.

Recasting the IF as a quest/colon, if feasible, is also a workaround.
Release Notes: A variable-length-array access for an array of at least two dimensions, if used in the predicate of an IF statement, may be mishandled and refer to an incorrect element, possibly outside the array.

 Description   

Pointer to VLA 2D array computation in IF condition is double-adjusted and garbled


Generated at Wed Apr 16 13:13:10 CDT 2025 using Jira 9.12.17#9120017-sha1:aba4002bcd633f188b6a4bb5dd8a0e1f20b79ee4.