Avoid creating memory mappings with a negative size

This should completely fix #479 this time.
This commit is contained in:
Pierre Pronchery 2018-05-09 01:26:01 +02:00
parent 24374e6dea
commit 84fca4cabf

View File

@ -1309,7 +1309,7 @@ class Linux(Platform):
:raises error:
- "Error in brk!" if there is any error allocating the memory
'''
if brk != 0 and brk != self.elf_brk:
if brk != 0 and brk > self.elf_brk:
mem = self.current.memory
size = brk - self.elf_brk
if brk > mem._ceil(self.elf_brk):