> I thought that some optimization cases mentioned on this page could be
> handled by segregating the sanitizing code from the accesses themselves.
Can you please elaborate what do you mean by segregation here?
Is it actually treating the sanitizing code as function calls taking
the variables as parameters? If so, the optimizer is quite limited in
his ability to move code across function calls, and we'll anyway need
to treat these sanitize(...) functions specially in the compiler
(which is the point of
https://code.google.com/p/address-sanitizer/wiki/CompileTimeOptimizations).
> Then, cases like this:
>
> int glob;
> int get_glob() {
> return glob;
> }
>
> can be handled trivially as it's known that sanitizing address of a variable
> referenced by name is a no-op--even for automatic locals, not just globals.
Automatic local variables may be accessed out of their bounds or after
the execution has left their scope.
Not checking them requires accurate proof of their addresses not escaping.
> Furthermore, there may be interesting consequences from switching to an
> approach of this kind. For example, if sanitizing code is segregated from
> accesses, then the optimizer has a chance to do some common and uncommon
> things about the first. An example for the common case would look like this:
>
> if (...)
> sanitize(a, ...);
> *a = ...;
> else
> sanitize(a, ...);
> *a = ...;
>
> optimized to:
>
> sanitize(a, ...);
>
> if (...)
> *a = ...;
> else
> *a = ...;
the condition
> Sanitize-specific optimizations would include things like this:
>
> struct { int a, b; } x; ...
> sanitize(&x.a, sizeof(x.a), ...);
> x.a = ...;
> sanitize(&x.b, sizeof(x.b), ...);
> x.b = ...;
>
> optimized to:
>
> struct _S { int a, b; } x; ...
> sanitize(&x.a, offsetof(_S, b) + sizeof(x.b), ...);
> x.a = ...;
> x.b = ...;
>
> etc...
>
> Will you have a chance, please let me know if you ever did consider this
> way.
>
> Thanks,
>
> --
> You received this message because you are subscribed to the Google Groups
> "address-sanitizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
Thank you,
Alex
--
You received this message because you are subscribed to the Google Groups
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.