Skip to content

Commit 3fe8d6f

Browse files
committed
Fix doc typos in new safety page
1 parent 27607e5 commit 3fe8d6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: docs/cpp2/safety.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ cppfront myfile.cpp2 -no-div-zero-checks # division by zero not checked
6767

6868
### <a id="null-dereference"></a> Null dereference (run-time checked)
6969

70-
Dereferencing a null pointer is undefined behavior, and is rejected at run time by checking the pointer is nonzero.
70+
Dereferencing a null pointer is undefined behavior, and is rejected at run time by checking the pointer is not null.
7171

7272
To disable this check at a specific place in your code, use `unchecked_dereference`. For example:
7373

@@ -92,7 +92,7 @@ cppfront myfile.cpp2 -no-null-checks # null dereferences not checked
9292

9393
### <a id="subscript-bounds"></a> Subscript bounds (run-time checked)
9494

95-
Accessing an out of bounds subscript is undefined behavior, and is rejected at run time by checking the subscript is nonzero. For an expression `a[b]` where
95+
Accessing an out of bounds subscript is undefined behavior, and is rejected at run time by checking the subscript is in bounds. For an expression `a[b]` where
9696

9797
- `a` is contiguous and supports `std::size(a)`, and
9898
- `b` is an integral value

0 commit comments

Comments
 (0)