| @@ -352,7 +352,7 @@ private: | |||||||||||||||
| 352 | dataCopyPadExtParamsGamma.paddingValue = 0; | 352 | dataCopyPadExtParamsGamma.paddingValue = 0; | ||||||||||||
| 353 | DataCopyExtParams copyInParamsGamma; | 353 | DataCopyExtParams copyInParamsGamma; | ||||||||||||
| 354 | copyInParamsGamma.blockCount = 1; | 354 | copyInParamsGamma.blockCount = 1; | ||||||||||||
| 355 | - copyInParamsGamma.blockLen = xGammaBetaAlign * sizeof(T_X); | 355 | + copyInParamsGamma.blockLen = numR * sizeof(T_X); | ||||||||||||
| 356 | copyInParamsGamma.srcStride = 0; | 356 | copyInParamsGamma.srcStride = 0; | ||||||||||||
| 357 | copyInParamsGamma.dstStride = 0; | 357 | copyInParamsGamma.dstStride = 0; | ||||||||||||
| 358 | DataCopyPad(gammaLocal, gammaGm, copyInParamsGamma, dataCopyPadExtParamsGamma); | 358 | DataCopyPad(gammaLocal, gammaGm, copyInParamsGamma, dataCopyPadExtParamsGamma); | ||||||||||||
| @@ -367,7 +367,11 @@ private: | |||||||||||||||
| 367 | dataCopyPadExtParamsScales.paddingValue = 0; | 367 | dataCopyPadExtParamsScales.paddingValue = 0; | ||||||||||||
| 368 | DataCopyExtParams copyInParamsScales; | 368 | DataCopyExtParams copyInParamsScales; | ||||||||||||
| 369 | copyInParamsScales.blockCount = 1; | 369 | copyInParamsScales.blockCount = 1; | ||||||||||||
| 370 | - copyInParamsScales.blockLen = scalesAlign * sizeof(T_SCALES); | 370 | + if (numQ == 1) { | ||||||||||||
| 371 | + copyInParamsScales.blockLen = sizeof(T_SCALES); | ||||||||||||||
| 372 | + } else { | ||||||||||||||
| 373 | + copyInParamsScales.blockLen = numR * sizeof(T_SCALES); | ||||||||||||||
| 374 | + } | ||||||||||||||
| 371 | copyInParamsScales.srcStride = 0; | 375 | copyInParamsScales.srcStride = 0; | ||||||||||||
| 372 | copyInParamsScales.dstStride = 0; | 376 | copyInParamsScales.dstStride = 0; | ||||||||||||
| 373 | DataCopyPad(scales1Local, scales1Gm, copyInParamsScales, dataCopyPadExtParamsScales); | 377 | DataCopyPad(scales1Local, scales1Gm, copyInParamsScales, dataCopyPadExtParamsScales); | ||||||||||||
| @@ -380,7 +384,11 @@ private: | |||||||||||||||
| 380 | dataCopyPadExtParamszeroPoints.paddingValue = 0; | 384 | dataCopyPadExtParamszeroPoints.paddingValue = 0; | ||||||||||||
| 381 | DataCopyExtParams copyInParamszeroPoints; | 385 | DataCopyExtParams copyInParamszeroPoints; | ||||||||||||
| 382 | copyInParamszeroPoints.blockCount = 1; | 386 | copyInParamszeroPoints.blockCount = 1; | ||||||||||||
| 383 | - copyInParamszeroPoints.blockLen = zeroPointsAlign * sizeof(T_ZEROPOINTS); | 387 | + if (numQ == 1) { | ||||||||||||
| 388 | + copyInParamszeroPoints.blockLen = sizeof(T_ZEROPOINTS); | ||||||||||||||
| 389 | + } else { | ||||||||||||||
| 390 | + copyInParamszeroPoints.blockLen = numR * sizeof(T_ZEROPOINTS); | ||||||||||||||
| 391 | + } | ||||||||||||||
🔴 Critical 在 这段代码是从第 370–374 行(scales 段)复制过来但未修改目标变量和类型。它导致了两个独立的缺陷:
触发条件:当 建议:将第 388 行的 改动建议
![]() ![]() | |||||||||||||||
| 384 | copyInParamszeroPoints.srcStride = 0; | 392 | copyInParamszeroPoints.srcStride = 0; | ||||||||||||
| 385 | copyInParamszeroPoints.dstStride = 0; | 393 | copyInParamszeroPoints.dstStride = 0; | ||||||||||||
| 386 | 394 | ||||||||||||||
| @@ -9,7 +9,6 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | - | ||
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | 14 | ||


🔴 Critical
第 385 行声明
DataCopyExtParams copyInParamszeroPoints;,随后第 386 行仅设置了blockCount = 1,blockLen字段从未被赋值。由于第 387–391 行的复制粘贴错误将 blockLen 错误地写到了
copyInParamsScales.blockLen(参见上一条 P0 报告),copyInParamszeroPoints.blockLen实际保持未初始化状态。第 392–393 行设置了
srcStride和dstStride,但blockLen仍然是栈上的脏数据。随后在第 406 行(
hasZeroPoints1路径)和第 413 行(hasZeroPoints2路径),DataCopyPad使用这个未初始化的copyInParamszeroPoints进行 GM→UB 数据搬移,导致:触发条件:
hasZeroPoints1 == true或hasZeroPoints2 == true时必然触发。建议:与上一条合并修复:将第 387–391 行的赋值目标从
copyInParamsScales改为copyInParamszeroPoints,类型从T_SCALES改为T_ZEROPOINTS。修复后copyInParamszeroPoints.blockLen即被正确初始化。