Skip to content

Commit 2acd024

Browse files
committed
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.
1 parent e9e1dd7 commit 2acd024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/goto-programs/interpreter_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class interpretert:public messaget
145145
return 0;
146146
std::size_t ret=0;
147147
std::size_t alloc_size=base_address_to_alloc_size(address);
148-
while(memory_iter!=memory.end() && ret<alloc_size)
148+
while(memory_iter!=memory.end() && memory_iter->first<(address+alloc_size))
149149
{
150150
++ret;
151151
++memory_iter;

0 commit comments

Comments
 (0)