-
Notifications
You must be signed in to change notification settings - Fork 4
validation
Árni Már Jónsson edited this page Jun 23, 2015
·
1 revision
For the reader API to work, the pointless data must be of the correct format, and certain invariants must hold. Examples include:
- offset vector items must not point outside the heap
- the root value must be a legal value
- all keys in a set/map must be hashable
If the data passes validation, the library gurantees that correct usage of the reader API will not crash the program. The validation is done in 2 passes:
Pass 1:
- check whether recursive depth exceeds POINTLESS_MAX_DEPTH
- check whether offset vectors are out-of-bounds
- perform basic sanity check on heap values
- validate inline-values
Pass 2:
- make sure all hashable vectors are acyclic, and contain (directly of indirectly) non-hashable values