It's a purely academic question. The arguments to swap are fixed. A hint that I received is that proc should do something to the stack. The crash has to happen on deferencing temp, not the arguments...
Type: Posts; User: Bontrey
It's a purely academic question. The arguments to swap are fixed. A hint that I received is that proc should do something to the stack. The crash has to happen on deferencing temp, not the arguments...
No no no, I'm asking about how to write a procedure 'proc', that when run in the 2nd segment of code, guarantees the deference in swap to crash.
Can't modify swap itself.
void swap (int *x, int *y) {
int *temp;
*temp = *x;
*x = *y;
*y = *temp;
}
This code, as you know, has a good chance of crashing depending on where the temp pointer points to....