Commit 5c68e6a
authored
[8.2] [MOD-11651] Fix wrong template type deduction in
[MOD-11651] Fix wrong template type deduction in `GenerateAndAddVector` (#785)
Prevent template deduction errors in GenerateAndAddVector by making data_t parameter non-deducible
Used std::type_identity<data_t>::type for the value parameter to force explicit template specification (e.g., GenerateAndAddVector<double>()) instead of allowing compiler to incorrectly deduce int from literal values, which caused buffer overflows when index expected different data types.
(cherry picked from commit 961d6eb)GenerateAndAddVector (#786)1 parent a51585e commit 5c68e6a
File tree
4 files changed
+12
-10
lines changed- tests/unit
4 files changed
+12
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1280 | 1280 | | |
1281 | 1281 | | |
1282 | 1282 | | |
1283 | | - | |
| 1283 | + | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1092 | 1092 | | |
1093 | 1093 | | |
1094 | 1094 | | |
1095 | | - | |
| 1095 | + | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | 1098 | | |
| |||
2772 | 2772 | | |
2773 | 2773 | | |
2774 | 2774 | | |
2775 | | - | |
| 2775 | + | |
2776 | 2776 | | |
2777 | 2777 | | |
2778 | 2778 | | |
| |||
2805 | 2805 | | |
2806 | 2806 | | |
2807 | 2807 | | |
2808 | | - | |
| 2808 | + | |
2809 | 2809 | | |
2810 | 2810 | | |
2811 | 2811 | | |
| |||
2854 | 2854 | | |
2855 | 2855 | | |
2856 | 2856 | | |
2857 | | - | |
| 2857 | + | |
2858 | 2858 | | |
2859 | 2859 | | |
2860 | 2860 | | |
| |||
2877 | 2877 | | |
2878 | 2878 | | |
2879 | 2879 | | |
2880 | | - | |
| 2880 | + | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | 2883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2083 | 2083 | | |
2084 | 2084 | | |
2085 | 2085 | | |
2086 | | - | |
| 2086 | + | |
2087 | 2087 | | |
2088 | 2088 | | |
2089 | 2089 | | |
| |||
2140 | 2140 | | |
2141 | 2141 | | |
2142 | 2142 | | |
2143 | | - | |
| 2143 | + | |
2144 | 2144 | | |
2145 | 2145 | | |
2146 | 2146 | | |
| |||
2162 | 2162 | | |
2163 | 2163 | | |
2164 | 2164 | | |
2165 | | - | |
| 2165 | + | |
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
0 commit comments