[DTrace-devel] [PATCH] Unify NULL pointer checking in dt_cg_check_notnull()
Kris Van Hees
kris.van.hees at oracle.com
Fri Jun 18 12:29:17 PDT 2021
On Fri, Jun 18, 2021 at 03:21:16PM -0400, Eugene Loh wrote:
> On 6/18/21 2:47 PM, Kris Van Hees wrote:
>
> > On Fri, Jun 18, 2021 at 02:33:59PM -0400, Kris Van Hees wrote:
> >> On Fri, Jun 18, 2021 at 02:26:32PM -0400, Eugene Loh wrote:
> >>> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> >>>
> >>> What will be the ordering of patches? If this goes in first, I can
> >>> tweak dt_cg_act_[u]stack() to use it. If those patches go in first,
> >>> this patch should include those two functions.
> >> This patch is planned to go before your stack related patches. So, yes, you
> >> make make use of it.
> > Actually, what do you mean... Where do you use NULL pointer checking in the
> > [u]stack implementation? I do not see any...
> Good point. Sorry. It's not a BADADDR but a BADSTACK.
>
> My main point is that by making the function broader, it could handle
> all of these cases. Indeed, one could eliminate the notnull() function
> altogether. Just beef dt_cg_probe_error() up to take a condition (NEQ,
> SGE, etc.) and a register. Thereby, one could serve the DIVZERO,
> BADADDR, and BADSTACK cases, eliminating the boilerplate that currently
> surrounds every dt_cg_probe_error() call. To me, it seems cleaner than
> using a narrowly defined notnull() function.
I'll give that some thought. Definitely not happening right now. I am also
not sure whether it will truly be an improvement or make for less clear code.
Kris
More information about the DTrace-devel
mailing list