TD2 II.4 Error is not a SegFault but a Stack Overflow
'
This commit is contained in:
parent
c3892a2fa7
commit
f277111e1c
2 changed files with 3 additions and 3 deletions
|
@ -54,7 +54,7 @@ int do_ThreadCreate(int f, int arg){
|
|||
// Check if we can allocate Stack for our son
|
||||
args->stackAddr = currentThread->space->AllocateUserStack();
|
||||
if ( args->stackAddr == -1 ) {
|
||||
fprintf(stderr, "Segmentation Fault - no space avaible on stack\n");
|
||||
fprintf(stderr, "Stack Overflow\n");
|
||||
Exit(1);
|
||||
}
|
||||
DEBUG('x',"Father found stack address: 0x%x\n", args->stackAddr);
|
||||
|
@ -88,7 +88,7 @@ void do_ThreadExit(){
|
|||
if ( currentThread->space->threads == 0 ){
|
||||
// No threads remains, desallocate addrspace
|
||||
delete currentThread->space;
|
||||
interrupt->Powerdown();
|
||||
Exit(0);
|
||||
}
|
||||
currentThread->Finish();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue