https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112709

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thinking about it, I'd say this should be instrumented differently between asan
and ubsan.  ubsan, which ought to just check whether the pointer is non-NULL
and properly aligned, should instrument it in the caller, so for returns_twice
on all the edges but the abnormal from .ABNORMAL_DISPATCHER, if there is just
one such edge, emit it on that edge, if there are multiple, split the block,
add PHIs and move the .ABNORMAL_DISPATCHER edge.  Because the function isn't
called for the second time actually, the argument where to store it to will be
the same in both cases.
For asan this is different, while the address to which the result is stored
will be the same, the memory might be poisoned in between, so I think we want
to instrument that on the callee side when storing into RESULT_DECL.

Reply via email to