[spam] software responsibility
gmkarl at gmail.com
Thu Nov 4 13:06:24 PDT 2021
let's review this patch history again. with longer output context. and
the knowledge that static memory is zero-initialised whether you want this
let's review this patch history again.
so the default context reuse is right at the top of the function. if there
is one, it bumps the refcount, points and returns, everything's good
libusb_init locks around a global lock, so things in it are not
the check if (ctx || !usbi_default_context) ... I think this is saying to
only execute the block if a new context is being made? but isn't that
always true? it replaced if (!ctx) which says, only if this is the default
let's see if the block is always true.
if ctx is nonzero, that's the normal case. then edge cases would be ctx is
if ctx is zero, then there's a block that checks for usbi_default_context
being nonzero, and short-circuits, returning.
so, after that block, usbi_default_context is zero if ctx is zero.
therefore, ctx || !usbi_default_context ....
uhh is saying ctx || (!ctx && !usbi_default_context)
and we just said that those two being zero, one implies the other
so ctx || !ctx, it would always be true.
hard to verify. 4 cases, 4 combinations of nonzeroness.
1 is eliminated by the short-circuit: !ctx, +dflt
leaves 3: ctx, dflt; ctx, !dflt; !ctx, !dflt
boolean logic! woot! oh man my whole universe is partial truth tables
omigod trues and falses, everywhere
I just so badly want to question whether true is _really_ true, or false
_really_ false. could a 1 or a 0 be a trick? you never know!
!ctx, dflt <- eliminated by short circuit?
remaining? -> ctx, dflt; ctx, !dflt; !ctx, !dflt
suddenly taking a break
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 2925 bytes
Desc: not available
More information about the cypherpunks