News for hackers. Stuff that matters.
Re:Google broke a conditional statement that verifies passwo... by dataflow on Thursday July 22, 2021 @04:59PM (#27924249)
Yeah. More specifically, it just inserts whatever behavior it likes for the undefined scenario, which in this case is "the same behavior as in the defined scenario".
Re:Google broke a conditional statement that verifies passwo... by ddalex on Friday July 23, 2021 @03:03AM (#27927996)
I am utterly confused. How would the compiler know that has_value() guarantees that the ->label dereferencing work, since this is a bitwise operation ?
Re:Google broke a conditional statement that verifies passwo... by dataflow on Friday July 23, 2021 @03:06AM (#27928022)
I would imagine has_value is checking to see if a pointer is NULL, and -> is dereferencing that same pointer. When the optimizer sees the two together it realizes the former is useless.
Re:Google broke a conditional statement that verifies passwo... by ddalex on Friday July 23, 2021 @06:43AM (#27929221)
by this logic the compiler would optimize any short-circuiting because it KNOWS the programmer WOULD NEVER deference an invalid pointer
Re:Google broke a conditional statement that verifies passwo... by jhasse on Friday July 23, 2021 @08:55AM (#27930116)
no, & is not short-circuiting