Fix asserts with side-effects (per Keegan McAllister)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
AM_CPPFLAGS = -I$(srcdir)/../terminal -I../protobufs $(BOOST_CPPFLAGS)
|
||||
AM_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../terminal -I../protobufs $(BOOST_CPPFLAGS)
|
||||
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||
|
||||
noinst_LIBRARIES = libmoshstatesync.a
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
|
||||
#include "completeterminal.h"
|
||||
#include "fatal_assert.h"
|
||||
|
||||
#include "hostinput.pb.h"
|
||||
|
||||
@@ -83,7 +84,7 @@ string Complete::diff_from( const Complete &existing ) const
|
||||
void Complete::apply_string( string diff )
|
||||
{
|
||||
HostBuffers::HostMessage input;
|
||||
assert( input.ParseFromString( diff ) );
|
||||
fatal_assert( input.ParseFromString( diff ) );
|
||||
|
||||
for ( int i = 0; i < input.instruction_size(); i++ ) {
|
||||
if ( input.instruction( i ).HasExtension( hostbytes ) ) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <typeinfo>
|
||||
|
||||
#include "user.h"
|
||||
#include "fatal_assert.h"
|
||||
#include "userinput.pb.h"
|
||||
|
||||
using namespace Parser;
|
||||
@@ -75,6 +76,7 @@ string UserStream::diff_from( const UserStream &existing ) const
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
|
||||
my_it++;
|
||||
@@ -86,7 +88,7 @@ string UserStream::diff_from( const UserStream &existing ) const
|
||||
void UserStream::apply_string( string diff )
|
||||
{
|
||||
ClientBuffers::UserMessage input;
|
||||
assert( input.ParseFromString( diff ) );
|
||||
fatal_assert( input.ParseFromString( diff ) );
|
||||
|
||||
for ( int i = 0; i < input.instruction_size(); i++ ) {
|
||||
if ( input.instruction( i ).HasExtension( keystroke ) ) {
|
||||
|
||||
Reference in New Issue
Block a user