From dee60d4fbf609c4c35ec08aaeb17a371a046a893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20G=C3=BCdemann?= Date: Sat, 3 Jun 2017 11:40:41 +0200 Subject: [PATCH] Correct size of allocated space for unbounded objects On 32 bit data models, there was an overflow due to an `unsigned long long` result cast into `size_t`, effectively preventing compilation on 32 bit systems. --- src/goto-programs/interpreter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/goto-programs/interpreter.cpp b/src/goto-programs/interpreter.cpp index 149f4002651..78d63fb9376 100644 --- a/src/goto-programs/interpreter.cpp +++ b/src/goto-programs/interpreter.cpp @@ -1200,7 +1200,7 @@ Function: interpretert::get_size Outputs: Size of the given type Purpose: Retrieves the actual size of the provided structured type. - Unbounded objects get allocated 2^32 address space each + Unbounded objects get allocated 2^31 address space each (of a 2^64 sized space). \*******************************************************************/ @@ -1208,7 +1208,7 @@ Function: interpretert::get_size size_t interpretert::get_size(const typet &type) { if(unbounded_size(type)) - return 2ULL << 32ULL; + return 1ULL << 31ULL; if(type.id()==ID_struct) {