Skip to content

Commit 259200b

Browse files
authored
Merge pull request #3246 from dkorpel/system-stack-pointer
Fix issue 22215 - returning expired stack pointers in `@system` code …
2 parents 974e0c9 + 0e09baa commit 259200b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/memory-safe-d.dd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ $(H2 $(LNAME2 usage, Usage))
3131
$(LI $(DDSUBLINK spec/function, system-functions, `@system`) functions)
3232
)
3333

34-
$(P `@system` functions may perform any operation legal from the perspective of the language including inherently
35-
memory unsafe operations like returning pointers to expired stackframes. These functions may not be called directly from
36-
`@safe` functions.)
34+
$(P `@system` functions may perform any operation legal from the perspective of the language,
35+
including inherently memory unsafe operations such as pointer casts or pointer arithmetic.
36+
However, compile-time known memory corrupting operations, such as indexing a static array
37+
out of bounds or returning a pointer to an expired stack frame, can still raise an error.
38+
`@system` functions may not be called directly from `@safe` functions.)
3739

3840
$(P `@trusted` functions have all the capabilities of `@system` functions but may be called from
3941
`@safe` functions. For this reason they should be very limited in the scope of their use. Typical uses of

0 commit comments

Comments
 (0)