Re: Are memory safety and maximized data volatility mutually exclusive?

"Jonathan S. Shapiro" <[email protected]> Thu, 8 Oct 2015 13:01:29 -0700
Newsgroups gmane.comp.capabilities.general
Message-ID <CAAP=3QPaJz_CUmYayqadRwroNocr=1=f1ScjbPNZ9s84L5H9rw@mail.gmail.com>
On Thursday, October 8, 2015, Scott Moore <[email protected]> wrote:
>
> The language standards are quite nice about letting compilers elide code
> that looks like make-work (why write a zero to this memory if no one will
> read it in the future?).
>

It's true that compilers can optimize this way, but only when the compiler
can *witness* that the write-zero is never consumed. Performing the zero
operation in a separately compiled procedure that is **NOT** specified by
the standard library (and therefore not elidable by the compiler based on
knowledge of the library specification) is generally sufficient. The
zeroing procedure will be conservative about use-after-store, and the call
to the zeroing procedure in a separately compiled object file cannot be
eluded because the compiler does not know in general what important side
effects may later occur.

Though strange things can happen if the call to a side effecting procedure
is immediately followed by exit()...

Jonathan

_______________________________________________
cap-talk mailing list
[email protected]
http://www.eros-os.org/mailman/listinfo/cap-talk