the first bounds checker for C? cc @kayseeseehttps://twitter.com/afd_icl/status/940687132502515713 …
But does it qualify if the check only works when the pointed-to array is known/in-scope?
-
-
I think to count, it has to pass bounds around for real, but I'd be interested in a reference
-
Pretty sure tinycc doesn't count then.
-
sorry, see other thread, it's OK to have a fast lookup structure (not sure if that's what tcc does)
End of conversation
New conversation -
-
-
Doing actual dynamic checks for the pointed-to object is hard and probably was not done until tools like tis-interpreter or (maybe? not sure it's complete) asan.
-
I think that looking up the bound by using a fast lookup structure (trie or whatever) keyed on address definitely should count: https://www.doc.ic.ac.uk/~phjk/BoundsChecking.html …
-
if all the arrays are implicitly heap allocated, and the allocator uses a cell-bitmap strategy (rather than linked lists of mem-objects), ... it is possible to get nearly* O(1) (* can predict and do a binary lookup for the heap-region, but this is usually negligible).
-
but, yeah, lookup array by address, and check relative bounds. a prior script VM of mine had implemented both its arrays and type-checks this way, and supported array offsetting via pointers into the middle of an array. similar could probably be used with C w/o too much issue.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.