Skip to content

Commit 5e1b65a

Browse files
committed
WIP Test unsafe array access in rust output
1 parent 9cd7164 commit 5e1b65a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/packTab/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def genCode(self, code, name=None, var="u", language="c"):
578578
if unitBits >= 8:
579579
if start:
580580
index = "%s+%s" % (start, language.as_usize(index))
581-
expr = "%s[%s]" % (arrName, index)
581+
expr = "unsafe { *(%s.get_unchecked(%s)) }" % (arrName, index)
582582
else:
583583
shift1 = int(round(log2(8 // unitBits)))
584584
mask1 = (8 // unitBits) - 1

0 commit comments

Comments
 (0)