You simply need to verify each access before allowing it, much like Valgrind does.
Of course it's quite costly do to so, and since C gives the programmer a lot of freedom I guess it's hard to optimize the tests, i.e. to know which accesses are safe without explicitly keeping track.
Comments
Of course it is possible in an interpreter.
You simply need to verify each access before allowing it, much like Valgrind does.
Of course it's quite costly do to so, and since C gives the programmer a lot of freedom I guess it's hard to optimize the tests, i.e. to know which accesses are safe without explicitly keeping track.
Are you sure? Even Valgrind does not detect everything. E.g. when you mess up variables within your stack.
That's quite different. Sandboxing in an interpreter is actually fairly easy.
Ok, you are right.