pointers to variable-length arrays - undefined behavior sanitizer
Uecker, Martin
Martin.Uecker@med.uni-goettingen.de
Tue Mar 27 16:30:00 GMT 2018
Hi,
I want to add run-time support for checking for equality of
the size expressions where pointers to variable-length arrays
are required to be compatible.
I wonder if you could give some advise on how to approach
this. One general question is where this should be added.
For example, I think it would be easy to instrument
function calls in gcc/ubsan.c . My initial attempt does
not work though because accessing the size expressions
seems to confuse the SSA renaming (or so I think). But maybe
it would be better to add this in the frontend anyway.
One could add additional options for comptypes and similar
functions to return an instrument_expr (similar to
pointer_diff) and use this when building the relevant
expressions. Any thoughts or advise would be highly
appreciated.
Martin
More information about the Gcc
mailing list