Open g-r-a-n-t opened 6 months ago
I will add unsafe expr checking to this as well.
It's still unclear to me what the unsafe
actually means in Fe. Do you have any concrete thoughts on this?
It's still unclear to me what the
unsafe
actually means in Fe. Do you have any concrete thoughts on this?
In general, code should be labeled as unsafe
if it has the potential to introduce undefined behavior during runtime. For instance, an invocation of evm::mstore(..)
could alter the value of data that is exclusively used in safe code, thus necessitating the unsafe
label.
Ok. So, in the v1 implementation, there are functions that don't cause undefined behavior (UB) but are still marked as unsafe, like RawCallBuffer::offset
, which merely returns an offset. Am I correct in understanding that these should not be marked as unsafe? I felt that unsafe was being somewhat abused in v1, so I want to eliminate any ambiguity in my understanding.
That is correct. I agree that unsafe
was overused in v1 and think that it should be used more sparingly in the v2 implementation.
Ok, thanks!
Implemented parsing for
unsafe
expressions.e.g.