bug fix in syncedprot.c (treat stackoverflow correctly)
This commit is contained in:
@ -163,10 +163,10 @@ long SyncedBegin(long syncid)
|
||||
return SYNCED_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
sp++;
|
||||
if (sp >= NSTACK) {
|
||||
return SYNCED_STACK_OVERFLOW;
|
||||
}
|
||||
sp++;
|
||||
sync->count++;
|
||||
actualSync = sync;
|
||||
return sync->id;
|
||||
@ -181,13 +181,13 @@ long SyncedEnd(long syncid)
|
||||
if (sp <= 0) {
|
||||
return SYNCED_STACK_UNDERFLOW;
|
||||
}
|
||||
sync = actualSync;
|
||||
sp--;
|
||||
sync = actualSync;
|
||||
actualSync = stack[sp];
|
||||
sync->count--;
|
||||
if (sync->count < 0) {
|
||||
if (sync->count <= 0) {
|
||||
return SYNCED_COUNT_UNDERFLOW;
|
||||
}
|
||||
sync->count--;
|
||||
if (syncid != 0 && syncid != sync->id) {
|
||||
return SYNCED_ID_MISMATCH;
|
||||
}
|
||||
|
Reference in New Issue
Block a user