Harden QuicStream::flow_controller_
This CL unblocks merge. Calling QuicheOptional::operator-> when there is no value present is undefined behavior. Chrome's implementation of QuicheOptional is more strict than the C++ standard library used in google3, and in debug builds it asserts when operator-> is used even though there is no value present. This is causing tests to fail and blocking merge.
This CL protects every single call to QuicStream::flow_controller_::operator-> with a check that verifies that a value was present. In almost all cases, it adds a QUIC_BUG to prove that this never happens in practice. The only case that does not have a QUIC_BUG is inside OnClose because this seems to be leveraged by multiple of our tests (QuicSessionTestClient.InvalidStreamFlowControlWindowInHandshake, QuicSessionTestServer.DontCallOnWriteBlockedForDisconnectedConnection, QuicSpdySessionTestClient.BadStreamFramePendingStream). We've confirmed that this CL fixes the merge issue.
Avoid undefined behavior, not flag protected
PiperOrigin-RevId: 311355214
Change-Id: I0e7d8c0c97815e1ed6f19509f0e64dfda8a32e5c
1 file changed