lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>>>>> "Yongheng" == Yongheng Chen <changochen1@gmail.com> writes:

 >> that condition looks a lot like "base + o - base == o" to me.

 Yongheng> I think you are correct. Then this check seems useless in
 Yongheng> normal situation?

The check seems like a misguided attempt to make up for the potential
undefined behavior of the prior pointer subtraction. i.e. it supposes
that on some hypothetical architecture (perhaps a segmented one), the
subtraction of two unrelated pointers might produce a value that when
added back to "base" does not recreate the original value.

(In fact, just performing the subtraction in cases like that is
undefined behavior, so there is no guarantee at all about what happens.)

-- 
Andrew.