From 2acd0244f4b8823191aa43222344f548e839d771 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 19 Jul 2017 15:06:09 +0100 Subject: [PATCH] Fix interpreter allocation sizing This could previously overestimate object sizes, potentially by including all other objects in the address space in the size estimate. That could lead to overly long variable-length arrays, with performance cost though most likely no correctness problems in Java, since all arrays have an explicit length. --- src/goto-programs/interpreter_class.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/goto-programs/interpreter_class.h b/src/goto-programs/interpreter_class.h index 9456037a474..956c71949de 100644 --- a/src/goto-programs/interpreter_class.h +++ b/src/goto-programs/interpreter_class.h @@ -145,7 +145,7 @@ class interpretert:public messaget return 0; std::size_t ret=0; std::size_t alloc_size=base_address_to_alloc_size(address); - while(memory_iter!=memory.end() && retfirst<(address+alloc_size)) { ++ret; ++memory_iter;