From 28ae47b6cb34f0a9080af3ec050e2aedf5425297 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

---
 alib2std/src/extensions/vector.hpp           | 2 +-
 alib2std/test-src/extensions/SharedPtrTest.h | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/alib2std/src/extensions/vector.hpp b/alib2std/src/extensions/vector.hpp
index 0f76931456..04ea3364be 100644
--- a/alib2std/src/extensions/vector.hpp
+++ b/alib2std/src/extensions/vector.hpp
@@ -135,7 +135,7 @@ ext::vector < bool, Ts ... > & operator ^= ( ext::vector < bool, Ts ... > & A, c
 		* ( 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 ++ );
+		* ( itA._M_p ++ ) = ~ * ( itA._M_p );
 
 	return A;
 }
diff --git a/alib2std/test-src/extensions/SharedPtrTest.h b/alib2std/test-src/extensions/SharedPtrTest.h
index bff20bd84a..2edbf3a9e6 100644
--- a/alib2std/test-src/extensions/SharedPtrTest.h
+++ b/alib2std/test-src/extensions/SharedPtrTest.h
@@ -62,6 +62,9 @@ class Base {
 public:
 	virtual Base* clone() const = 0;
 
+	virtual ~Base ( ) {
+	}
+
 };
 
 class Derived : public Base {
@@ -70,6 +73,9 @@ public:
 		return new Derived(*this);
 	}
 
+	virtual ~Derived ( ) override {
+	}
+
 };
 
 public:
-- 
GitLab