This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pointers to variable-length arrays - undefined behavior sanitizer


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]