Verify that usage after error does not lead to undefined behavior #21
Labels
enhancement
New feature or request
internal
Issue or pull request which is internal and has no user-visible effect
Problem solved by the enhancement
Both
JsonReader
andJsonWriter
say that you should abort using them on most errors, but they also say (emphasis mine):It should be verified that this is actually the case. In version 0.3.0 that should be the case because it does not use
unsafe
; however in the future theutf8.rs
module might useunsafe
to avoid UTF-8 validation where the data should be validated already.The question is however if this assumption that no undefined behavior will occur is still correct if users continue using
JsonReader
orJsonWriter
after an error occurred.Either way, the recommendation that
JsonReader
andJsonWriter
should not be used after an error was returned still applies.Enhancement description
Not necessarily a code change, but mainly reviewing the code
Code changes which are guaranteed to prevent any possible undefined behavior would of course be even better though.
The text was updated successfully, but these errors were encountered: