You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can figure that *s->a can be used to access any memory in the system breaking spatial memory safety. Moreover, this entire code can be written in a checked scope, prompting whether we should exclude casts from checked regions?
Thanks,
Arslan
The text was updated successfully, but these errors were encountered:
I'm not sure why the dynamic bounds cast to ptr<STRUCT> is allowed. We can tell that ptr<STRUCT> and ptr<char> (the type of &temp[20]) are not compatible. If it fails at run-time, then this code is fine, but I don't see why it shouldn't fail at compile-time.
@mwhicks1 I agree with you, the cast should fail at compile-time... however, just to add on this, the code doesn't fail on run-time as well even after I add the line before returning from the function: *(s->a) = 100;
Hi,
I have the following code:
As you can figure that *s->a can be used to access any memory in the system breaking spatial memory safety. Moreover, this entire code can be written in a checked scope, prompting whether we should exclude casts from checked regions?
Thanks,
Arslan
The text was updated successfully, but these errors were encountered: