Skip to content
Discussion options

You must be logged in to vote

Specifically, if I have the following on my stack, can a pointer to a be used to access b?

The compiler should insert enough padding for this. If you find a case where it is not, please file a bug.

I guess the same question applies to fields of structs: if I allocate an object with some large fields (on the heap or the stack), can a pointer to one of its fields bleed into another?

By default we do not enable sub-object bounds (and there's a compiler bug preventing them from being enabled (I'm not sure we're tracking this @rmn30 / @resistor?), which should be fixed soon). Without sub-object bounds, a pointer to a field has the bounds of the enclosing object.

With sub-object bounds, the…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jwnrt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants