From e63221e77dc007d257e39e5a613fbfad9fc45dca Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 13 Dec 2017 11:47:59 +0100 Subject: [PATCH] fix some undefined behaviour errors 2 --- alib2std/src/extensions/vector.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alib2std/src/extensions/vector.hpp b/alib2std/src/extensions/vector.hpp index 04ea3364be..4758ca9b96 100644 --- a/alib2std/src/extensions/vector.hpp +++ b/alib2std/src/extensions/vector.hpp @@ -134,8 +134,10 @@ ext::vector < bool, Ts ... > & operator ^= ( ext::vector < bool, Ts ... > & A, c while ( itB < B.end ( ) ) // A is longer or of the same size as B * ( itA._M_p ++ ) ^= * ( itB._M_p ++ ); // word-at-a-time bitwise operation - while ( itA < A.end ( ) ) // The rest of A above the size of B shall be flipped - * ( itA._M_p ++ ) = ~ * ( itA._M_p ); + while ( itA < A.end ( ) ) { // The rest of A above the size of B shall be flipped + * ( itA._M_p ) = ~ * ( itA._M_p ); + itA._M_p ++; + } return A; } -- GitLab