summaryrefslogtreecommitdiff
path: root/boost/multiprecision/cpp_int/import_export.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/multiprecision/cpp_int/import_export.hpp')
-rw-r--r--boost/multiprecision/cpp_int/import_export.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/boost/multiprecision/cpp_int/import_export.hpp b/boost/multiprecision/cpp_int/import_export.hpp
index 7bd843fb32..b975a79663 100644
--- a/boost/multiprecision/cpp_int/import_export.hpp
+++ b/boost/multiprecision/cpp_int/import_export.hpp
@@ -61,8 +61,7 @@ namespace boost {
// Check for overflow bits:
//
bit_location = sizeof(local_limb_type) * CHAR_BIT - bit_location;
- bits >>= bit_location;
- if(bits)
+ if((bit_location < sizeof(bits)*CHAR_BIT) && (bits >>= bit_location))
val.resize(2, 2); // May throw!
}
}