mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
rc: fix segfault when SIGINT is received
Save the value of `runq' at the start of the function, so that the `pc' update at the end does work on that original value, and not on a probably modified value of `runq'. fixes #14 http://code.swtch.com/plan9port/issue/14/ http://codereview.appspot.com/104066
This commit is contained in:
parent
1d534ed6ce
commit
74be46038d
1 changed files with 2 additions and 1 deletions
|
@ -110,6 +110,7 @@ Xpipe(void)
|
|||
void
|
||||
Xbackq(void)
|
||||
{
|
||||
struct thread *p = runq;
|
||||
char wd[8193];
|
||||
int c;
|
||||
char *s, *ewd=&wd[8192], *stop;
|
||||
|
@ -164,7 +165,7 @@ Xbackq(void)
|
|||
runq->argv->words = v;
|
||||
v = nextv;
|
||||
}
|
||||
runq->pc = runq->code[runq->pc].i;
|
||||
p->pc = p->code[p->pc].i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue