[Vm-dev] Question about pointer comparison

David T. Lewis lewis at mail.msen.com
Wed Mar 25 11:52:47 UTC 2015


On Tue, Mar 24, 2015 at 10:32:32PM -0700, Eliot Miranda wrote:
>  
> On Tue, Mar 24, 2015 at 8:33 PM, Nicolas Cellier <
> nicolas.cellier.aka.nice at gmail.com> wrote:
> 
> >
> > Hi,
> >
> > in checkStackIntegrity, there is a comparison of char *
> >
> > theSP <= frameRcvrOffset
> >
> > Is it OK, or should we better use oop:isLessThanOrEqualTo: ?
> >
> 
> Providing that both are typed as non-void pointers to the same type this
> will work.  oop:isLessThanOrEqualTo: is there for comparing sqInt values
> (i.e. oops) as this is a signed type and oop:isLessThanOrEqualTo: forces an
> unsigned comparison.

Agreed, both variables are (char *), so the pointer comparison is OK as written.

Dave



More information about the Vm-dev mailing list