Skip to content

Commit 38ed885

Browse files
committed
New issue from Hewill: "Hardening simd::vec::operator[]"
1 parent bb10c66 commit 38ed885

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

xml/issue4408.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4408" status="New">
5+
<title>Hardening `simd::vec::operator[]`</title>
6+
<section>
7+
<sref ref="[simd.subscr]"/>
8+
<sref ref="[simd.mask.subscr]"/>
9+
</section>
10+
<submitter>Hewill Kang</submitter>
11+
<date>07 Oct 2025</date>
12+
<priority>99</priority>
13+
14+
<discussion>
15+
<p>
16+
`simd::vec::operator[]` satisfies the criteria in <paper num="P3471R4"/> and <paper num="P3697R1"/> :
17+
"violating the precondition results in a memory safety issue", which means that hardening is reasonable.
18+
</p>
19+
</discussion>
20+
21+
<resolution>
22+
<p>
23+
This wording is relative to <paper num="N5014"/>.
24+
</p>
25+
26+
<ol>
27+
28+
<li><p>Modify <sref ref="[simd.subscr]"/> as indicated:</p>
29+
30+
<blockquote>
31+
<pre>
32+
constexpr value_type operator[](<i>simd-size-type</i> i) const;
33+
</pre>
34+
<blockquote>
35+
<p>
36+
-1- <i><ins>Hardened </ins><del>P</del><ins>p</ins>reconditions</i>: <code>i &gt;= 0 &amp;&amp; i &lt; size()</code> is `true`.
37+
</p>
38+
</blockquote>
39+
</blockquote>
40+
</li>
41+
42+
<li><p>Modify <sref ref="[simd.mask.subscr]"/> as indicated:</p>
43+
44+
<blockquote>
45+
<pre>
46+
constexpr value_type operator[](<i>simd-size-type</i> i) const;
47+
</pre>
48+
<blockquote>
49+
<p>
50+
-1- <i><ins>Hardened </ins><del>P</del><ins>p</ins>reconditions</i>: <code>i &gt;= 0 &amp;&amp; i &lt; size()</code> is `true`.
51+
</p>
52+
</blockquote>
53+
</blockquote>
54+
</li>
55+
</ol>
56+
57+
</resolution>
58+
59+
</issue>

0 commit comments

Comments
 (0)