handle oom

This commit is contained in:
Sam Clegg 2018-01-13 09:23:30 -08:00
parent 3ce20a9f57
commit ddb01fbf88

View File

@ -1354,6 +1354,10 @@ function syscall_writev(fd, iov, iovcnt) {
}
function syscall_brk(value) {
if (value > heap_size_bytes) {
print('brk failed: memsize: ' + heap_size_bytes + ' requested: ' + value);
return -1;
}
if (value != 0)
heap_end = value;
return heap_end;