Skip to content

Commit

Permalink
Fixed clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
federicovilla55 committed Mar 3, 2024
1 parent 6fb2320 commit ef3fe58
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/syscall/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ class BrkSyscall : public BaseSyscall {
// Retrieves the argument of the brk syscall, the new program break
uint64_t newBreak = BaseSyscall::getArg(BaseSyscall::REG_FILE, 0);
// Retrieve the current stack pointer from the processor handler
uint64_t stackPointer = ProcessorHandler::getProcessor()->getRegister(BaseSyscall::REG_FILE, 2);
uint64_t stackPointer =
ProcessorHandler::getProcessor()->getRegister(BaseSyscall::REG_FILE, 2);
if (newBreak >= stackPointer) {
SystemIO::printString("Error: Attempted to allocate memory overlapping stack segment\n");
BaseSyscall::setRet(BaseSyscall::REG_FILE, 0, -1); // Syscall error code
return;
SystemIO::printString(
"Error: Attempted to allocate memory overlapping stack segment\n");
BaseSyscall::setRet(BaseSyscall::REG_FILE, 0, -1); // Syscall error code
return;
}

BaseSyscall::setRet(BaseSyscall::REG_FILE, 0, 0);
}
};
Expand Down

0 comments on commit ef3fe58

Please sign in to comment.