You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OOB write to alloca for col-major cbuffer matrix subscript when rows > cols #7865
Description
When you have a col_major (the default) matrix in a cbuffer with a higher number of rows than columns, the compiler produces invalid DXIL that writes to an out-of-bounds index of an alloca.
Actual Behavior
Compiled with validation disabled (-Vd) Produces:
%1 = alloca [2 x float], align4%9 = getelementptrinbounds [2 x float], [2 x float]* %1, i320, i322storefloat%6, float* %9, align4; And, where %2 should be in range 0-2:%10 = getelementptrinbounds [2 x float], [2 x float]* %1, i320, i32%2
With validation enabled (without -Vd):
<source>:14:15: error: Access to out-of-bounds memory is disallowed.
note: at '%11 = getelementptr inbounds [2 x float], [2 x float]* %3, i32 0, i32 2' in block '#0' of function 'main'.
Validation failed.
Activity
Fix OOB in subscript indexing of col-major matrix in cbuffer (microso…